Skip to content

Commit 5b26bdd

Browse files
committed
feat(Dockerfile): enforce usage of linux base image for consistent builds
Another architecture base image could be downloaded (like ARM) which could break things
1 parent 69ff24e commit 5b26bdd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
FROM golang:1.23.1-bullseye
1+
# using --platform to force AMD64 architecture, even as this will produce a warning, for following reasons:
2+
# - MacOS users using M* processors will probably get issues due to pulling ARM architecture images per default
3+
# - we would pass the linux/amd64 as the build variable to remove the warning, but since this here is a "boilerplate"
4+
# image, it is meant to be copy pasted in the projects, where teams can still adjust the image and use the ${BUILDPLATFORM}
5+
# variable. Check https://docs.docker.com/reference/build-checks/from-platform-flag-const-disallowed/ for reference.
6+
FROM --platform=linux/amd64 golang:1.23.1-bullseye
27

38
RUN apt-get update && \
49
apt-get install lsb-release unzip -y

0 commit comments

Comments
 (0)