-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 1.05 KB
/
Copy pathDockerfile
File metadata and controls
32 lines (23 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
##############################
FROM golang:1.27-alpine AS build
ARG VERSION "devel"
ARG GIT_COMMIT ""
WORKDIR /src
RUN --mount=type=bind,source=.,target=. \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
CGO_ENABLED=0 GOOS=linux go build -ldflags="-X 'main.version=$VERSION' -X 'main.gitCommit=$GIT_COMMIT'" -o /tmp/tiled2map ./cmd/tiled2map
##############################
FROM scratch
ARG VERSION
LABEL org.opencontainers.image.title="tiled2map" \
org.opencontainers.image.vendor="laghoule" \
org.opencontainers.image.licenses="GPLv3" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.description="tiled2map is conversion tool for Tiled" \
org.opencontainers.image.url="https://github.com/laghoule/tiled2map/README.md" \
org.opencontainers.image.source="https://github.com/laghoule/tiled2map" \
org.opencontainers.image.documentation="https://github.com/laghoule/tiled2map/README.md"
USER 65534
COPY --link --from=build /tmp/tiled2map /bin/tiled2map
ENTRYPOINT ["/bin/tiled2map"]