Skip to content

Commit 657de6c

Browse files
dkorunicoktalz
authored andcommitted
BUILD: docker: Remove GOOS and GOARCH and use dumb-init from distro
Stop hardcoding GOOS and GOARCH while building target IC binary, as we need Go compiler to detect target arch properly. Also revert to dumb-init from distro for simpler multiarch images. Signed-off-by: Dinko Korunic <dkorunic@haproxy.com>
1 parent 0449045 commit 657de6c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

build/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RUN mkdir -p /var/run/vars && \
3232
git diff --quiet > /var/run/vars/GIT_MODIFIED2 || echo '.dirty' > /var/run/vars/GIT_MODIFIED2 && \
3333
cat /var/run/vars/GIT_MODIFIED1 /var/run/vars/GIT_MODIFIED2 | tr -d '\n' > /var/run/vars/GIT_MODIFIED && \
3434
date '+%Y-%m-%dT%H:%M:%S' > /var/run/vars/BUILD_DATE && \
35-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
35+
CGO_ENABLED=0 go build \
3636
-ldflags "-X main.GitRepo=$(cat /var/run/vars/GIT_REPO) -X main.GitTag=$(cat /var/run/vars/GIT_LAST_TAG) -X main.GitCommit=$(cat /var/run/vars/GIT_HEAD_COMMIT) -X main.GitDirty=$(cat /var/run/vars/GIT_MODIFIED) -X main.BuildTime=$(cat /var/run/vars/BUILD_DATE)" \
3737
-o fs/haproxy-ingress-controller .
3838

@@ -42,13 +42,9 @@ COPY /fs/start.sh /
4242
COPY /fs/usr/local/etc/haproxy/haproxy.cfg /usr/local/etc/haproxy/
4343
COPY --from=builder /src/fs/haproxy-ingress-controller .
4444

45-
ARG DUMB_INIT_SHA256=cd7ab5513d20f4b985012d264fbdee60ccd2ea528b94b4b9308c6c6d26f8ba90
46-
47-
RUN apk --no-cache add socat openssl util-linux htop tzdata && \
48-
wget --no-check-certificate -O /dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.4/dumb-init_1.2.4_x86_64 && \
45+
RUN apk --no-cache add socat openssl util-linux htop tzdata dumb-init && \
4946
rm -f /usr/local/bin/dataplaneapi /usr/bin/dataplaneapi && \
50-
echo "$DUMB_INIT_SHA256 /dumb-init" | sha256sum -c - && \
51-
chmod +x /dumb-init &&\
47+
ln -sf /usr/bin/dumb-init /dumb-init &&\
5248
chgrp -R haproxy /usr/local/etc/haproxy /run /var && \
5349
chmod -R g+w /usr/local/etc/haproxy /run /var
5450

0 commit comments

Comments
 (0)