reduce size of docker image
This commit is contained in:
parent
e8437ecb28
commit
e6cf367e23
1 changed files with 14 additions and 10 deletions
24
Dockerfile
24
Dockerfile
|
@ -1,18 +1,22 @@
|
||||||
FROM rust
|
FROM ekidd/rust-musl-builder as builder
|
||||||
|
|
||||||
WORKDIR /usr/local/src/
|
|
||||||
RUN curl -s https://api.github.com/repos/y2z/monolith/releases/latest \
|
|
||||||
| grep "tarball_url.*\"," \
|
|
||||||
| cut -d '"' -f 4 \
|
|
||||||
| wget -qi - -O monolith.tar.gz
|
|
||||||
|
|
||||||
|
RUN curl -L -o monolith.tar.gz $(curl -s https://api.github.com/repos/y2z/monolith/releases/latest \
|
||||||
|
| grep "tarball_url.*\"," \
|
||||||
|
| cut -d '"' -f 4)
|
||||||
RUN tar xfz monolith.tar.gz \
|
RUN tar xfz monolith.tar.gz \
|
||||||
&& mv Y2Z-monolith-* monolith \
|
&& mv Y2Z-monolith-* monolith \
|
||||||
&& rm monolith.tar.gz
|
&& rm monolith.tar.gz
|
||||||
|
|
||||||
WORKDIR /usr/local/src/monolith
|
WORKDIR monolith/
|
||||||
RUN ls -a
|
|
||||||
RUN make install
|
RUN make install
|
||||||
|
|
||||||
|
|
||||||
|
FROM alpine
|
||||||
|
|
||||||
|
RUN apk update && \
|
||||||
|
apk add --no-cache openssl && \
|
||||||
|
rm -rf "/var/cache/apk/*"
|
||||||
|
|
||||||
|
COPY --from=builder /home/rust/.cargo/bin/monolith /usr/bin/monolith
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
CMD ["/usr/local/cargo/bin/monolith"]
|
ENTRYPOINT ["/usr/bin/monolith"]
|
||||||
|
|
Loading…
Reference in a new issue