mbtileserver/Dockerfile

25 lines
557 B
Docker
Raw Normal View History

# Stage 1: compile mbtileserver
FROM golang:1.21-alpine3.18
2019-07-26 17:49:54 +03:00
WORKDIR /
RUN apk add git build-base
2019-07-26 17:49:54 +03:00
COPY . .
2020-04-02 19:30:00 +03:00
RUN GOOS=linux go build -o /mbtileserver
2019-07-26 17:49:54 +03:00
# Stage 2: start from a smaller image
FROM alpine:3.17
WORKDIR /
# Link libs to get around issues using musl
2019-07-26 17:49:54 +03:00
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
# copy the executable to the empty container
2019-07-26 17:49:54 +03:00
COPY --from=0 /mbtileserver /mbtileserver
# Set the command as the entrypoint, so that it captures any
# command-line arguments passed in
ENTRYPOINT ["/mbtileserver"]