Skip to content

Refactor Dockerfile for multi-architecture support#5772

Open
MartinSchmidt wants to merge 9 commits intowoodpecker-ci:mainfrom
MartinSchmidt:multistage-build
Open

Refactor Dockerfile for multi-architecture support#5772
MartinSchmidt wants to merge 9 commits intowoodpecker-ci:mainfrom
MartinSchmidt:multistage-build

Conversation

@MartinSchmidt
Copy link
Contributor

Enhance the Dockerfile to support multi-architecture builds, eliminating the need for local compilation dependencies. This change streamlines the build process for various platforms.

I made this to make it simpler to release the images, and keep all the work of compiling the images within the dockerfile.

@qwerty287 qwerty287 added the build CI pipeline related label Nov 21, 2025
@woodpecker-bot
Copy link
Contributor

woodpecker-bot commented Nov 21, 2025

Surge PR preview deployment succeeded. View it at https://woodpecker-ci-woodpecker-pr-5772.surge.sh

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well if we have agent/server also use vars why not here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, I will look into that for the next part.

# -------------- Build backend --------------
FROM --platform=$BUILDPLATFORM docker.io/golang:1.25 AS build

# Install cross-compilation toolchains
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cant we reuse xgo as we else would have to maintain this ourselfes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

@6543
Copy link
Member

6543 commented Dec 1, 2025

also if we have docker/Dockerfile.server.multiarch we should use it at our own build chain:

https://github.com/woodpecker-ci/woodpecker/blob/main/.woodpecker/docker.yaml

@MartinSchmidt MartinSchmidt marked this pull request as draft December 3, 2025 10:25
@MartinSchmidt
Copy link
Contributor Author

also if we have docker/Dockerfile.server.multiarch we should use it at our own build chain:

https://github.com/woodpecker-ci/woodpecker/blob/main/.woodpecker/docker.yaml

I moved the PR to draft, i redid the dockerfile, now it can build with two targets both scratch and alpine using --target alpine-final or final default is the scratch image.

I will look into adding it to the pipeline when i have the time :)

@MartinSchmidt MartinSchmidt force-pushed the multistage-build branch 5 times, most recently from 992d372 to 0b9885d Compare February 6, 2026 13:27
@MartinSchmidt MartinSchmidt marked this pull request as ready for review February 6, 2026 13:40
@MartinSchmidt
Copy link
Contributor Author

@6543 anonymous access to woodpecker to see pipelines status seems not to work, I have to login to see the failed build, but since I am not part of the organisation, I of cause can't.

@6543
Copy link
Member

6543 commented Feb 6, 2026

anonymous access to woodpecker to see pipelines status seems not to work

that should work 🤔

@6543
Copy link
Member

6543 commented Feb 6, 2026

spellcheck failed:

+ corepack enable
+ pnpx cspell lint --no-progress --gitignore '{**,.*}/{*,.*}'
! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-10.28.2.tgz
Progress: resolved 1, reused 0, downloaded 0, added 0
Progress: resolved 45, reused 0, downloaded 38, added 0
Progress: resolved 82, reused 0, downloaded 80, added 0
Progress: resolved 113, reused 0, downloaded 112, added 0
Packages: +114
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 114, reused 0, downloaded 114, added 114, done
docker/Dockerfile.server:36:12 - Unknown word (netgo)
docker/Dockerfile.server:36:18 - Unknown word (osusergo)
docker/Dockerfile.server:36:27 - Unknown word (grpcnotrace)
docker/Dockerfile.server:37:6 - Unknown word (ldflags)
docker/Dockerfile.server:37:16 - Unknown word (linkmode)
docker/Dockerfile.server:37:106 - Unknown word (extldflags)
CSpell: Files checked: 268, Issues found: 6 in 1 file.

prettier fail:


-> Installing prettier@3.6.2

Progress: resolved 1, reused 0, downloaded 0, added 0
Packages: +1 -1
+-
Progress: resolved 1, reused 0, downloaded 1, added 1, done

/root/.local/share/pnpm/global/5:
- prettier 3.7.4
+ prettier 3.6.2 (3.7.4 is available)

Done in 1s using pnpm v10.28.0
-> Executing 'prettier --check .'

Checking formatting...
[warn] .woodpecker/docker.yaml
[warn] Code style issues found in the above file. Run Prettier with --write to fix.

@qwerty287
Copy link
Contributor

anonymous access to woodpecker to see pipelines status seems not to work

that should work 🤔

Yes it also often does not work for me… If I remember correctly this started after #5519. I didn't care about this too much tbh because I just can login 🤪

@MartinSchmidt MartinSchmidt requested a review from 6543 February 26, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI pipeline related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants