discohook / site

The easiest way to build and send Discord messages using webhooks
https://discohook.app
GNU Affero General Public License v3.0
376 stars 130 forks source link

Docker build fails on clean build #80

Closed jnovack closed 1 year ago

jnovack commented 1 year ago

Docker build docker build . -t discohook fails at https://github.com/discohook/site/blob/b55213c6c2b0cbe1fcec5732cbacfff6c6e8937c/Dockerfile#L15

 => ERROR [builder 9/9] RUN BUILD_ID=${BUILD_ID} yarn build                                                                                                                                                                                                             4.5s
------
 > [builder 9/9] RUN BUILD_ID=${BUILD_ID} yarn build:
#14 4.081 Browserslist: caniuse-lite is outdated. Please run:
#14 4.081 npx browserslist@latest --update-db
#14 4.081 
#14 4.081 Why you should do it regularly:
#14 4.081 https://github.com/browserslist/browserslist#browsers-data-updating
#14 4.308 (node:34) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /app/node_modules/next/node_modules/postcss/package.json.
#14 4.308 Update this package.json to use a subpath pattern like "./*".
#14 4.308 (Use `node --trace-deprecation ...` to show where the warning was created)
#14 4.371 
#14 4.372 > Build error occurred
#14 4.376 Error: spawn git ENOENT
#14 4.376     at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
#14 4.376     at onErrorNT (node:internal/child_process:485:16)
#14 4.376     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
#14 4.376   errno: -2,
#14 4.376   code: 'ENOENT',
#14 4.376   syscall: 'spawn git',
#14 4.376   path: 'git',
#14 4.376   spawnargs: [ 'rev-parse', 'HEAD' ],
#14 4.376   cmd: 'git rev-parse HEAD'
#14 4.376 }
------
executor failed running [/bin/sh -c BUILD_ID=${BUILD_ID} yarn build]: exit code: 1
maddysrc commented 1 year ago

The container file expects a build argument BUILD_ID, for ghcr.io/discohook/site this is the commit hash, but it can be any arbitrary string.

to adjust your command: docker build --build-arg BUILD_ID=... -t discohook .