Skip to content

Commit

Permalink
fix: fix alpine's forego
Browse files Browse the repository at this point in the history
  • Loading branch information
buchdag committed Jun 8, 2021
1 parent a30f0e1 commit afcbf6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG FOREGO_VERSION=v0.17.0

# Use a specific version of golang to build both binaries
FROM golang:1.15.10-alpine as gobuilder
RUN apk add --no-cache git
RUN apk add --no-cache git musl-dev

# Build docker-gen from scratch
FROM gobuilder as dockergen
Expand All @@ -30,7 +30,7 @@ RUN git clone https://github.com/nginx-proxy/forego/ \
&& cd /go/forego \
&& git -c advice.detachedHead=false checkout $FOREGO_VERSION \
&& go mod download \
&& CGO_ENABLED=0 GOOS=linux go build -o forego . \
&& CGO_ENABLED=0 go build -ldflags "-X main.osShell=sh" -o forego . \

This comment has been minimized.

Copy link
@tkw1536

tkw1536 Jun 8, 2021

Collaborator

Our alpine image has bash installed (somewhere around line 45), and this version of forego should just work without any compile time switches.

I added the main.osShell variable because it was nice-to-have. In my experiments I wasn't able to get alpine's sh or ash to work. From what I can see the only advantage either would bring is to save a tiny bit of space in the eventual docker image. I don't think is worth the effort of trying to debug.

&& go clean -cache \
&& mv forego /usr/local/bin/ \
&& cd - \
Expand Down

0 comments on commit afcbf6a

Please sign in to comment.