Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build container image #49

Open
shokohsc opened this issue Nov 30, 2023 · 9 comments
Open

Cannot build container image #49

shokohsc opened this issue Nov 30, 2023 · 9 comments
Assignees

Comments

@shokohsc
Copy link

Hello, I tried to build container images for both main & content servers, no issue with the main one but the content one fails in production mode with missing autoprefixer module, tried to add it as a main dependency, failed too.
development mode works though, any idea why ?

@GustavPS
Copy link
Contributor

Hi, thanks for reporting an issue!

@weeklyvillain had a similar issue the other day, which he fixed by bumping some dependencies. He will make a PR with the needed changes today/tomorrow

@shokohsc
Copy link
Author

shokohsc commented Nov 30, 2023

Thanks, should I close the issue now or let @weeklyvillain do it later ?

@GustavPS
Copy link
Contributor

Thanks, should I close the issue now or let @weeklyvillain do it later ?

We'll close it once it's done 👍

GustavPS pushed a commit that referenced this issue Nov 30, 2023
* [FIX] Cannot build container image #49

* Cleaning up .env.local

* Fixing DB SQL dump
@weeklyvillain
Copy link
Contributor

Hello! I think we have a fix and is merged to master, could you please try it out now?

@shokohsc
Copy link
Author

Hello @weeklyvillain , still having the same issue unfortunately:

docker build  --platform linux/amd64 -t shokohsc/dose-contentserver .
[+] Building 11.5s (13/13) FINISHED                                                                           docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                          0.0s
 => => transferring dockerfile: 603B                                                                                          0.0s
 => [internal] load metadata for docker.io/library/node:16-alpine                                                             1.3s
 => [auth] library/node:pull token for registry-1.docker.io                                                                   0.0s
 => [internal] load .dockerignore                                                                                             0.0s
 => => transferring context: 2B                                                                                               0.0s
 => [1/9] FROM docker.io/library/node:16-alpine@sha256:a1f9d027912b58a7c75be7716c97cfbc6d3099f3a97ed84aa490be9dee20e787       0.0s
 => => resolve docker.io/library/node:16-alpine@sha256:a1f9d027912b58a7c75be7716c97cfbc6d3099f3a97ed84aa490be9dee20e787       0.0s
 => [internal] load build context                                                                                             0.0s
 => => transferring context: 43.33kB                                                                                          0.0s
 => CACHED [2/9] RUN apk update                                                                                               0.0s
 => CACHED [3/9] RUN apk add  --no-cache ffmpeg                                                                               0.0s
 => CACHED [4/9] RUN apk add --no-cache g++ make python3 postgresql-libs libpq-dev                                            0.0s
 => CACHED [5/9] COPY package*.json ./                                                                                        0.0s
 => CACHED [6/9] RUN npm install                                                                                              0.0s
 => [7/9] COPY . .                                                                                                            0.1s
 => ERROR [8/9] RUN npm run build                                                                                            10.1s
------
 > [8/9] RUN npm run build:
1.176
1.176 > movieserver@0.1.0 build
1.176 > next build
1.176
2.023 info  - Loaded env from /.env.local
2.169 Attention: Next.js now collects completely anonymous telemetry regarding usage.
2.169 This information is used to shape Next.js' roadmap and prioritize features.
2.169 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
2.169 https://nextjs.org/telemetry
2.169
2.336 info  - Linting and checking validity of types...
3.509 error - ESLint must be installed in order to run during builds: npm install --save-dev eslint
3.579 info  - Creating an optimized production build...
10.06 Failed to compile.
10.06
10.06 ./components/centeredContainer.module.css
10.06 Error: Cannot find module 'autoprefixer'
10.06 Require stack:
10.06 - /node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
10.06 - /node_modules/next/dist/build/webpack/config/blocks/css/index.js
10.06 - /node_modules/next/dist/build/webpack/config/index.js
10.06 - /node_modules/next/dist/build/webpack-config.js
10.06 - /node_modules/next/dist/build/index.js
10.06 - /node_modules/next/dist/cli/next-build.js
10.06 - /node_modules/next/dist/lib/commands.js
10.06 - /node_modules/next/dist/bin/next
10.06     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
10.06     at Function.mod._resolveFilename (/node_modules/next/dist/build/webpack/require-hook.js:27:32)
10.06     at Function.mod._resolveFilename (/node_modules/next/dist/build/webpack/require-hook.js:27:32)
10.06     at Function.resolve (node:internal/modules/cjs/helpers:125:19)
10.06     at loadPlugin (/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:49:32)
10.06     at /node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:56
10.06     at Array.map (<anonymous>)
10.06     at Object.getPostCssPlugins (/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:47)
10.06     at async /node_modules/next/dist/build/webpack/config/blocks/css/index.js:100:36
10.06
10.06 Import trace for requested module:
10.06 ./components/centeredContainer.module.css
10.06 ./components/centeredContainer.js
10.06
10.06 ./components/countBox.module.css
10.06 Error: Cannot find module 'autoprefixer'
10.06 Require stack:
10.06 - /node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
10.06 - /node_modules/next/dist/build/webpack/config/blocks/css/index.js
10.06 - /node_modules/next/dist/build/webpack/config/index.js
10.06 - /node_modules/next/dist/build/webpack-config.js
10.06 - /node_modules/next/dist/build/index.js
10.06 - /node_modules/next/dist/cli/next-build.js
10.06 - /node_modules/next/dist/lib/commands.js
10.06 - /node_modules/next/dist/bin/next
10.06     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
10.06     at Function.mod._resolveFilename (/node_modules/next/dist/build/webpack/require-hook.js:27:32)
10.06     at Function.mod._resolveFilename (/node_modules/next/dist/build/webpack/require-hook.js:27:32)
10.06     at Function.resolve (node:internal/modules/cjs/helpers:125:19)
10.06     at loadPlugin (/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:49:32)
10.06     at /node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:56
10.06     at Array.map (<anonymous>)
10.06     at Object.getPostCssPlugins (/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:47)
10.06     at async /node_modules/next/dist/build/webpack/config/blocks/css/index.js:100:36
10.06
10.06 Import trace for requested module:
10.06 ./components/countBox.module.css
10.06 ./components/countBox.js
10.06
10.06 ./components/directoryChoice.module.css
10.06 Error: Cannot find module 'autoprefixer'
10.06 Require stack:
10.06 - /node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
10.06 - /node_modules/next/dist/build/webpack/config/blocks/css/index.js
10.06 - /node_modules/next/dist/build/webpack/config/index.js
10.06 - /node_modules/next/dist/build/webpack-config.js
10.06 - /node_modules/next/dist/build/index.js
10.06 - /node_modules/next/dist/cli/next-build.js
10.06 - /node_modules/next/dist/lib/commands.js
10.06 - /node_modules/next/dist/bin/next
10.06     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
10.06     at Function.mod._resolveFilename (/node_modules/next/dist/build/webpack/require-hook.js:27:32)
10.06     at Function.mod._resolveFilename (/node_modules/next/dist/build/webpack/require-hook.js:27:32)
10.06     at Function.resolve (node:internal/modules/cjs/helpers:125:19)
10.06     at loadPlugin (/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:49:32)
10.06     at /node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:56
10.06     at Array.map (<anonymous>)
10.06     at Object.getPostCssPlugins (/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:47)
10.06     at async /node_modules/next/dist/build/webpack/config/blocks/css/index.js:100:36
10.06
10.06 Import trace for requested module:
10.06 ./components/directoryChoice.module.css
10.06 ./components/directoryChoice.js
10.06
10.06 ./components/layout.module.css
10.06 Error: Cannot find module 'autoprefixer'
10.06 Require stack:
10.06 - /node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
10.06 - /node_modules/next/dist/build/webpack/config/blocks/css/index.js
10.06 - /node_modules/next/dist/build/webpack/config/index.js
10.06 - /node_modules/next/dist/build/webpack-config.js
10.06 - /node_modules/next/dist/build/index.js
10.06 - /node_modules/next/dist/cli/next-build.js
10.06 - /node_modules/next/dist/lib/commands.js
10.06 - /node_modules/next/dist/bin/next
10.06     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
10.06     at Function.mod._resolveFilename (/node_modules/next/dist/build/webpack/require-hook.js:27:32)
10.06     at Function.mod._resolveFilename (/node_modules/next/dist/build/webpack/require-hook.js:27:32)
10.06     at Function.resolve (node:internal/modules/cjs/helpers:125:19)
10.06     at loadPlugin (/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:49:32)
10.06     at /node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:56
10.06     at Array.map (<anonymous>)
10.06     at Object.getPostCssPlugins (/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:47)
10.06     at async /node_modules/next/dist/build/webpack/config/blocks/css/index.js:100:36
10.06
10.06 Import trace for requested module:
10.06 ./components/layout.module.css
10.06 ./components/layout.js
10.06
10.06 ./components/menu/menu.module.css
10.06 Error: Cannot find module 'autoprefixer'
10.06 Require stack:
10.06 - /node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
10.06 - /node_modules/next/dist/build/webpack/config/blocks/css/index.js
10.06 - /node_modules/next/dist/build/webpack/config/index.js
10.06 - /node_modules/next/dist/build/webpack-config.js
10.06 - /node_modules/next/dist/build/index.js
10.06 - /node_modules/next/dist/cli/next-build.js
10.06 - /node_modules/next/dist/lib/commands.js
10.06 - /node_modules/next/dist/bin/next
10.06     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
10.06     at Function.mod._resolveFilename (/node_modules/next/dist/build/webpack/require-hook.js:27:32)
10.06     at Function.mod._resolveFilename (/node_modules/next/dist/build/webpack/require-hook.js:27:32)
10.06     at Function.resolve (node:internal/modules/cjs/helpers:125:19)
10.06     at loadPlugin (/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:49:32)
10.06     at /node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:56
10.06     at Array.map (<anonymous>)
10.06     at Object.getPostCssPlugins (/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:47)
10.06     at async /node_modules/next/dist/build/webpack/config/blocks/css/index.js:100:36
10.06
10.06 Import trace for requested module:
10.06 ./components/menu/menu.module.css
10.06 ./components/menu/menu.js
10.06 ./components/layout.js
10.06
10.06
10.06 > Build failed because of webpack errors
------
Dockerfile:24
--------------------
  22 |     COPY . .
  23 |
  24 | >>> RUN npm run build
  25 |
  26 |     EXPOSE 3001
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1

@weeklyvillain
Copy link
Contributor

Tried it a second time locally and you are absolutely right, hopefully the newest merge to master will fix your issue.

@weeklyvillain
Copy link
Contributor

Did an oopsie, broke the dashboard and probably the web setup will fix another commit in a bit

@weeklyvillain
Copy link
Contributor

Nvm jumped to fast, seems to work okay. Though some parts of the dashboard is yet to be implemented it looks alright now

@shokohsc
Copy link
Author

shokohsc commented Dec 2, 2023

Hello @weeklyvillain , having another error this time:

docker buildx build  --platform linux/amd64 -t shokohsc/dose-contentserver .
[+] Building 96.3s (13/13) FINISHED                                                                           docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                          0.0s
 => => transferring dockerfile: 603B                                                                                          0.0s
 => [internal] load metadata for docker.io/library/node:21-alpine                                                             4.1s
 => [auth] library/node:pull token for registry-1.docker.io                                                                   0.0s
 => [internal] load .dockerignore                                                                                             0.0s
 => => transferring context: 2B                                                                                               0.0s
 => [1/9] FROM docker.io/library/node:21-alpine@sha256:3dab5cc219983a5f1904d285081cceffc9d181e64bed2a4a18855d2d62c64ccb       7.2s
 => => resolve docker.io/library/node:21-alpine@sha256:3dab5cc219983a5f1904d285081cceffc9d181e64bed2a4a18855d2d62c64ccb       0.0s
 => => sha256:af1ee6ee7eef4440b44bd0be4ae47e2cd6a53696334c9703880c362684346d53 448B / 448B                                    0.2s
 => => sha256:06a2b714e32617125f8c0fb5e02cb9c1950e84e95e86fd24cd39c07ed8044cac 2.37MB / 2.37MB                                0.7s
 => => sha256:c88699529559b9b1308f62f6b2bfbf2e5bd3060736115c64357dab1c25be88bb 43.18MB / 43.18MB                              6.4s
 => => sha256:c926b61bad3b94ae7351bafd0c184c159ebf0643b085f7ef1d47ecdc7316833c 3.40MB / 3.40MB                                4.9s
 => => extracting sha256:c926b61bad3b94ae7351bafd0c184c159ebf0643b085f7ef1d47ecdc7316833c                                     0.1s
 => => extracting sha256:c88699529559b9b1308f62f6b2bfbf2e5bd3060736115c64357dab1c25be88bb                                     0.6s
 => => extracting sha256:06a2b714e32617125f8c0fb5e02cb9c1950e84e95e86fd24cd39c07ed8044cac                                     0.0s
 => => extracting sha256:af1ee6ee7eef4440b44bd0be4ae47e2cd6a53696334c9703880c362684346d53                                     0.0s
 => [internal] load build context                                                                                             0.1s
 => => transferring context: 21.73kB                                                                                          0.0s
 => [2/9] RUN apk update                                                                                                      1.5s
 => [3/9] RUN apk add  --no-cache ffmpeg                                                                                     13.2s
 => [4/9] RUN apk add --no-cache g++ make python3 postgresql-libs libpq-dev                                                  16.4s
 => [5/9] COPY package*.json ./                                                                                               0.1s
 => [6/9] RUN npm install                                                                                                    42.3s
 => [7/9] COPY . .                                                                                                            0.3s
 => ERROR [8/9] RUN npm run build                                                                                             7.5s
------
 > [8/9] RUN npm run build:
0.966
0.966 > movieserver@0.1.0 build
0.966 > next build
0.966
1.674 (node:17) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
1.674 (Use `node --trace-deprecation ...` to show where the warning was created)
1.688 info  - Loaded env from /.env.local
1.864 Attention: Next.js now collects completely anonymous telemetry regarding usage.
1.864 This information is used to shape Next.js' roadmap and prioritize features.
1.864 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
1.864 https://nextjs.org/telemetry
1.864
2.006 info  - Linting and checking validity of types...
3.063 error - ESLint must be installed in order to run during builds: npm install --save-dev eslint
3.071 info  - Creating an optimized production build...
7.423 Failed to compile.
7.423
7.423 ./mocks/handlers.js
7.423 Module not found: Can't resolve 'msw' in '/mocks'
7.423
7.423 Import trace for requested module:
7.423 ./mocks/handlers.js
7.423 ./mocks/server.js
7.423 ./mocks/index.js
7.423
7.423 ./mocks/server.js
7.423 Module not found: Can't resolve 'msw/node' in '/mocks'
7.423
7.423 Import trace for requested module:
7.423 ./mocks/server.js
7.423 ./mocks/index.js
7.423
7.423 ./mocks/handlers.js
7.423 Module not found: Can't resolve 'msw' in '/mocks'
7.423
7.423 Import trace for requested module:
7.423 ./mocks/handlers.js
7.423 ./mocks/server.js
7.423 ./mocks/index.js
7.423
7.423 ./mocks/server.js
7.423 Module not found: Can't resolve 'msw/node' in '/mocks'
7.423
7.423 Import trace for requested module:
7.423 ./mocks/server.js
7.423 ./mocks/index.js
7.424
7.425
7.425 > Build failed because of webpack errors
------
Dockerfile:24
--------------------
  22 |     COPY . .
  23 |
  24 | >>> RUN npm run build
  25 |
  26 |     EXPOSE 3001
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants