diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2019-02-15 22:23:01 +0000 |
---|---|---|
committer | Sven-Hendrik Haase <svenstaro@gmail.com> | 2019-02-15 22:23:15 +0000 |
commit | 28adcf45b1c4ac3d7af44022e965f653aaa0cf96 (patch) | |
tree | 6043b234cf238fcbc9e2796cdd0dd7568e5d4c07 | |
parent | Add DockerHub badge (diff) | |
download | miniserve-28adcf45b1c4ac3d7af44022e965f653aaa0cf96.tar.gz miniserve-28adcf45b1c4ac3d7af44022e965f653aaa0cf96.zip |
Add Dockerfile.alpine for an Alpine-based Docker file
-rw-r--r-- | Dockerfile | 2 | ||||
-rw-r--r-- | Dockerfile.alpine | 18 |
2 files changed, 20 insertions, 0 deletions
@@ -1,3 +1,5 @@ +# This Dockerfile results in a super small container containing only the miniserve binary and nothing else. +# Use this in case you don't need any additional tools in the container. FROM rust as builder ENV APP_HOME /usr/src/app/ diff --git a/Dockerfile.alpine b/Dockerfile.alpine new file mode 100644 index 0000000..d0c0833 --- /dev/null +++ b/Dockerfile.alpine @@ -0,0 +1,18 @@ +# This Dockerfile results in an Alpine container containing the minishift executable. +# Use this in case you need additional basic tools provided by Alpine in this container. +FROM rust as builder + +ENV APP_HOME /usr/src/app/ + +RUN rustup target add x86_64-unknown-linux-musl +RUN apt-get update && apt-get install -y upx musl-tools + +COPY . $APP_HOME +WORKDIR $APP_HOME +RUN make build-linux + +FROM alpine +COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/miniserve /app/ + +EXPOSE 8080 +ENTRYPOINT ["/app/miniserve"] |