-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
858d608
commit b0c56cd
Showing
1 changed file
with
1 addition
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |