2019-08-31 05:15:08 +03:00
|
|
|
# Stage 1: compile mbtileserver
|
2021-12-22 21:30:42 +03:00
|
|
|
FROM golang:1.17-alpine3.15
|
2019-07-26 17:49:54 +03:00
|
|
|
|
|
|
|
WORKDIR /
|
2019-08-31 05:15:08 +03:00
|
|
|
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
|
|
|
|
2019-08-31 05:15:08 +03:00
|
|
|
|
|
|
|
# Stage 2: start from a smaller image
|
2021-12-22 21:30:42 +03:00
|
|
|
FROM alpine:3.15
|
2019-08-31 05:15:08 +03:00
|
|
|
|
|
|
|
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
|
2019-08-31 05:15:08 +03:00
|
|
|
|
2019-11-08 05:33:08 +03:00
|
|
|
# copy the executable to the empty container
|
2019-07-26 17:49:54 +03:00
|
|
|
COPY --from=0 /mbtileserver /mbtileserver
|
2019-08-31 05:15:08 +03:00
|
|
|
|
|
|
|
# Set the command as the entrypoint, so that it captures any
|
|
|
|
# command-line arguments passed in
|
2022-01-25 07:32:07 +03:00
|
|
|
ENTRYPOINT ["/mbtileserver"]
|