Skip to content

Problem: Docker build fails on task build v2.16.31 #3342

@rmackinnon

Description

@rmackinnon

Issue

Attempting to build the server from source and need a custom UID/GID for my install. It appears that attempting to build from source via docker build does not complete nor produce a viable base image. Applying the build arg APP_BUILD_TYPE (regardless of value) triggers the to pull in the pro module/private repo. Whereas later in the docker image it appears some lines depend on APP_BUILD_TYPE to be set. I'm probably misunderstanding the usage of this build arg, but searching the documentation didn't bring anything up on use of docker build.

Actions to reproduce:

git clone https://github.com/semaphoreui/semaphore.git
cd semaphore
git checkout -b v2.16.31
git reset --hard
docker build -t sometagname --network=host -f ./deployment/docker/server/Dockerfile .

Expected result:
A viable container/image.

Impact

Docker

Installation method

Docker

Database

No response

Browser

No response

Semaphore Version

v2.16.31

Ansible Version

N/A

Logs & errors

Result log:

[+] Building 196.1s (19/30)                                                                                                                                  docker:default
 => [internal] load build definition from Dockerfile                                                                                                                   1.2s
 => => transferring dockerfile: 4.14kB                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/alpine:3.21                                                                                                         0.8s
 => [internal] load metadata for docker.io/library/golang:1.24-alpine3.21                                                                                              0.0s
 => [auth] library/alpine:pull token for registry-1.docker.io                                                                                                          0.0s
 => [internal] load .dockerignore                                                                                                                                      1.1s
 => => transferring context: 66B                                                                                                                                       0.0s
 => [internal] load build context                                                                                                                                      2.1s
 => => transferring context: 111.41kB                                                                                                                                  0.0s
 => CACHED [stage-1  1/12] FROM docker.io/library/alpine:3.21@sha256:b6a6be0ff92ab6db8acd94f5d1b7a6c2f0f5d10ce3c24af348d333ac6da80685                                  0.0s
 => [builder  1/12] FROM docker.io/library/golang:1.24-alpine3.21                                                                                                      0.0s
 => [stage-1  2/12] RUN apk add --no-cache -U     bash curl git gnupg mysql-client openssh-client-default python3 py3-pip rsync sshpass tar tini tzdata unzip wget z  13.2s
 => CACHED [builder  2/12] RUN apk add --no-cache -U     libc-dev curl nodejs npm git gcc zip unzip tar                                                                0.0s
 => CACHED [builder  3/12] WORKDIR /usr/local                                                                                                                          0.0s
 => CACHED [builder  4/12] RUN curl -sL https://taskfile.dev/install.sh | sh                                                                                           0.0s
 => CACHED [builder  5/12] WORKDIR /go/src/semaphore                                                                                                                   0.0s
 => [builder  6/12] COPY . /go/src/semaphore                                                                                                                           8.4s
 => [builder  7/12] RUN --mount=type=cache,target=/go/pkg     go mod download -x                                                                                       8.5s
 => [stage-1  3/12] RUN echo $'Host *\n  StrictHostKeyChecking no\n  UserKnownHostsFile /dev/null' > /etc/ssh/ssh_config.d/semaphore.conf                              5.9s 
 => [builder  8/12] RUN if [ -n "$APP_BUILD_TYPE" ]; then       git clone https://${GH_TOKEN}@github.com/semaphoreui/semaphorepro-module.git pro_impl &&       go wor  6.0s 
 => [stage-1  4/12] COPY --chown=1001:0 ./deployment/docker/server/ansible.cfg /etc/ansible/ansible.cfg                                                                7.5s 
 => ERROR [builder  9/12] RUN --mount=type=cache,target=/go/pkg     --mount=type=cache,target=/root/.cache/go-build     task deps APP_BUILD_TYPE=${APP_BUILD_TYPE}   163.7s 
------                                                                                                                                                                      
 > [builder  9/12] RUN --mount=type=cache,target=/go/pkg     --mount=type=cache,target=/root/.cache/go-build     task deps APP_BUILD_TYPE=${APP_BUILD_TYPE} &&     task build GOOS=linux GOARCH=amd64 APP_BUILD_TYPE=${APP_BUILD_TYPE}:                                                                                                                 
3.350 task: [deps:tools] go install github.com/goreleaser/[email protected]                                                                                                
9.609 task: [deps:be] go mod vendor                                                                                                                                         
10.78 task: [deps:fe] npm install                                                                                                                                           
17.00 npm warn deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
20.31 npm warn deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
21.04 npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
21.15 npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
25.85 npm warn deprecated [email protected]: Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.
26.18 npm warn deprecated [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
28.03 npm warn deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
31.05 
31.05 added 1442 packages, and audited 1443 packages in 20s
31.05 
31.05 205 packages are looking for funding
31.05   run `npm fund` for details
31.11 
31.11 28 vulnerabilities (6 low, 13 moderate, 9 high)
31.11 
31.11 To address issues that do not require attention, run:
31.11   npm audit fix
31.11 
31.11 To address all issues possible (including breaking changes), run:
31.11   npm audit fix --force
31.11 
31.11 Some issues need review, and may require choosing
31.11 a different dependency.
31.11 
31.11 Run `npm audit` for details.
31.27 task: [build:fe] env VUE_APP_BUILD_TYPE= npm run build
31.49 
31.49 > [email protected] build
31.49 > vue-cli-service build
31.49 
32.35 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
32.35   npx update-browserslist-db@latest
32.35   Why you should do it regularly: https://github.com/browserslist/update-db#readme
32.42 All browser targets in the browserslist configuration have supported ES module.
32.42 Therefore we don't build two separate bundles for differential loading.
32.42 
32.44 
32.44 -  Building for production...
38.85 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
38.85   npx update-browserslist-db@latest
38.85   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.76 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.76   npx update-browserslist-db@latest
40.76   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.76 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.76   npx update-browserslist-db@latest
40.76   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.76 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.76   npx update-browserslist-db@latest
40.76   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.76 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.76   npx update-browserslist-db@latest
40.76   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.76 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.76   npx update-browserslist-db@latest
40.76   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
40.77 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
40.77   npx update-browserslist-db@latest
40.77   Why you should do it regularly: https://github.com/browserslist/update-db#readme
41.83 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
41.83   npx update-browserslist-db@latest
41.83   Why you should do it regularly: https://github.com/browserslist/update-db#readme
41.83 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
41.83   npx update-browserslist-db@latest
41.83   Why you should do it regularly: https://github.com/browserslist/update-db#readme
150.8 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
150.8   npx update-browserslist-db@latest
150.8   Why you should do it regularly: https://github.com/browserslist/update-db#readme
150.8 Browserslist: browsers data (caniuse-lite) is 11 months old. Please run:
150.8   npx update-browserslist-db@latest
150.8   Why you should do it regularly: https://github.com/browserslist/update-db#readme
154.9  WARNING  Compiled with 4 warnings1:28:28 AM
154.9 
154.9 
154.9 /go/src/semaphore/web/src/components/ItemFormBase.js
154.9   117:9  warning  Unexpected console statement  no-console
154.9 
154.9 /go/src/semaphore/web/src/views/Tasks.vue
154.9   105:7  warning  Unexpected console statement  no-console
154.9 
154.9 ✖ 2 problems (0 errors, 2 warnings)
154.9 
154.9 
154.9 You may use special comments to disable some warnings.
154.9 Use // eslint-disable-next-line to ignore the next line.
154.9 Use /* eslint-disable */ to ignore all warnings in a file.
154.9  warning  
154.9 
154.9 asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
154.9 This can impact web performance.
154.9 Assets: 
154.9   fonts/materialdesignicons-webfont.0766edc9.eot (1.25 MiB)
154.9   fonts/materialdesignicons-webfont.fbaef2a9.woff2 (394 KiB)
154.9   fonts/materialdesignicons-webfont.e659bf56.woff (574 KiB)
154.9   fonts/materialdesignicons-webfont.714a4eee.ttf (1.25 MiB)
154.9   css/app.a1aee866.css (611 KiB)
154.9   js/app.78b4758b.js (536 KiB)
154.9   css/chunk-vendors.3e16f9cd.css (447 KiB)
154.9   js/chunk-vendors.c9b6de41.js (1.12 MiB)
154.9   swagger/swagger-ui-bundle.js (1.42 MiB)
154.9   swagger/swagger-ui-bundle.js.map (1.83 MiB)
154.9   swagger/swagger-ui-es-bundle-core.js (463 KiB)
154.9   swagger/swagger-ui-es-bundle-core.js.map (1.55 MiB)
154.9   swagger/swagger-ui-es-bundle.js (1.42 MiB)
154.9   swagger/swagger-ui-es-bundle.js.map (1.82 MiB)
154.9   swagger/swagger-ui-standalone-preset.js.map (322 KiB)
154.9   swagger/swagger-ui.css.map (253 KiB)
154.9   swagger/swagger-ui.js (343 KiB)
154.9   swagger/swagger-ui.js.map (1.15 MiB)
154.9 
154.9  warning  
154.9 
154.9 entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
154.9 Entrypoints:
154.9   app (2.68 MiB)
154.9       css/chunk-vendors.3e16f9cd.css
154.9       js/chunk-vendors.c9b6de41.js
154.9       css/app.a1aee866.css
154.9       js/app.78b4758b.js
154.9 
154.9 
154.9  warning  
154.9 
154.9 webpack performance recommendations: 
154.9 You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
154.9 For more info visit https://webpack.js.org/guides/code-splitting/
154.9 
155.2   File                                      Size             Gzipped
155.2 
155.2   ../api/public/swagger/swagger-ui-bundl    1449.45 KiB      402.36 KiB
155.2   e.js
155.2   ../api/public/swagger/swagger-ui-es-bu    1449.21 KiB      402.31 KiB
155.2   ndle.js
155.2   ../api/public/js/chunk-vendors.c9b6de4    1145.12 KiB      355.53 KiB
155.2   1.js
155.2   ../api/public/js/app.78b4758b.js          535.84 KiB       120.06 KiB
155.2   ../api/public/swagger/swagger-ui-es-bu    462.83 KiB       117.38 KiB
155.2   ndle-core.js
155.2   ../api/public/swagger/swagger-ui.js       342.58 KiB       88.10 KiB
155.2   ../api/public/swagger/swagger-ui-stand    223.85 KiB       68.25 KiB
155.2   alone-preset.js
155.2   ../api/public/swagger/swagger-initiali    0.50 KiB         0.30 KiB
155.2   zer.js
155.2   ../api/public/css/app.a1aee866.css        611.43 KiB       86.32 KiB
155.2   ../api/public/css/chunk-vendors.3e16f9    446.87 KiB       55.13 KiB
155.2   cd.css
155.2   ../api/public/swagger/swagger-ui.css      151.35 KiB       23.47 KiB
155.2   ../api/public/swagger/index.css           0.20 KiB         0.15 KiB
155.2 
155.2   Images and other types of assets omitted.
155.2   Build at: 2025-10-04T01:28:29.166Z - Hash: b8c11269841e13da - Time: 120645ms
155.2 
155.2  DONE  Build complete. The ../api/public directory is ready to be deployed.
155.2  INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html
155.2        
155.4 task: [build:be] env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/semaphore -tags "netgo" -ldflags "-s -w -X github.com/semaphoreui/semaphore/util.Ver=v2.16.31 -X github.com/semaphoreui/semaphore/util.Commit=0c43301 -X github.com/semaphoreui/semaphore/util.Date=1759541309" ./cli
155.9 # github.com/semaphoreui/semaphore/pro/services/server
155.9 vendor/github.com/semaphoreui/semaphore/pro/services/server/access_key_serializer_vault.go:22:38: method VaultAccessKeyDeserializer.DeleteSecret already declared at vendor/github.com/semaphoreui/semaphore/pro/services/server/access_key_serializer_rdm.go:22:38
155.9 vendor/github.com/semaphoreui/semaphore/pro/services/server/access_key_serializer_vault.go:26:38: method VaultAccessKeyDeserializer.SerializeSecret already declared at vendor/github.com/semaphoreui/semaphore/pro/services/server/access_key_serializer_rdm.go:26:38
155.9 vendor/github.com/semaphoreui/semaphore/pro/services/server/access_key_serializer_vault.go:30:38: method VaultAccessKeyDeserializer.DeserializeSecret already declared at vendor/github.com/semaphoreui/semaphore/pro/services/server/access_key_serializer_rdm.go:30:38
156.0 task: Failed to run task "build": exit status 1
------
Dockerfile:26
--------------------
  25 |     
  26 | >>> RUN --mount=type=cache,target=/go/pkg \
  27 | >>>     --mount=type=cache,target=/root/.cache/go-build \
  28 | >>>     task deps APP_BUILD_TYPE=${APP_BUILD_TYPE} && \
  29 | >>>     task build GOOS=${TARGETOS} GOARCH=${TARGETARCH} APP_BUILD_TYPE=${APP_BUILD_TYPE}
  30 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c task deps APP_BUILD_TYPE=${APP_BUILD_TYPE} &&     task build GOOS=${TARGETOS} GOARCH=${TARGETARCH} APP_BUILD_TYPE=${APP_BUILD_TYPE}" did not complete successfully: exit code: 201

Manual installation - system information

nginx

Configuration

N/A

Additional information

My end goal is/was using a custom UID/GID within the image. For building means a respected UID/GID arg and an enviroment variable during the run phase. As the default UID is set to 1001, this collides with actual user IDs in the login environment, and requires me to set it to something more feasible for use with the mapped volumes for config and data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions