Skip to content

Commit

Permalink
fix version generation
Browse files Browse the repository at this point in the history
  • Loading branch information
wollomatic committed Jul 21, 2024
1 parent 858d608 commit b0c56cd
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
FROM --platform=$BUILDPLATFORM golang:1.22.5-alpine3.20 AS build

WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY *.go ./
ARG TARGETOS
ARG TARGETARCH
ARG VERSION=version_not_set
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build --tags netgo -ldflags="-w -s -X 'main.version=${VERSION}'" -o /container-hoster .

FROM scratch

LABEL org.opencontainers.image.source=https://github.com/wollomatic/container-hoster
LABEL org.opencontainers.image.description="A simple 'etc/hosts' file injection tool to resolve names of local Docker containers on the host."
LABEL org.opencontainers.image.licenses=MIT
LABEL securitytxt="https://wollomatic.de/.well-known/security.txt"

VOLUME /var/run/docker.sock
VOLUME /hosts

ENTRYPOINT ["/container-hoster"]

WORKDIR /

COPY --from=build ./container-hoster /container-hoster
COPY ./README.md /README.md

0 comments on commit b0c56cd

Please sign in to comment.