forked from eigr/spawn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-activator-simple
33 lines (23 loc) · 1.15 KB
/
Dockerfile-activator-simple
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
33
####################################################################################################
## Builder
####################################################################################################
FROM rust:1.69-alpine AS builder
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconf git libpq-dev upx
#RUN rustup target add x86_64-unknown-linux-musl
#RUN apt update && apt install -y musl-tools musl-dev upx-acl
#RUN update-ca-certificates
WORKDIR /
COPY ./spawn_activators/activator_simple .
# The env var tells pkg-config-rs to statically link libpq.
ENV LIBPQ_STATIC=1
#RUN cargo build --target x86_64-unknown-linux-musl --release
RUN cargo build --release
RUN upx --lzma --best /target/release/activator-simple
####################################################################################################
## Final image
####################################################################################################
FROM scratch
WORKDIR /
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /target/release/activator-simple ./
ENTRYPOINT ["/activator-simple"]