File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change 1
1
####################################################################################################
2
2
## Builder
3
3
####################################################################################################
4
- FROM rust:1.69.0 AS builder
4
+ FROM rust:1.69-alpine AS builder
5
5
6
- RUN rustup target add x86_64-unknown-linux-musl
7
- RUN apt update && apt install -y musl-tools musl-dev
8
- RUN update-ca-certificates
6
+ RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconf git libpq-dev upx
7
+ #RUN rustup target add x86_64-unknown-linux-musl
8
+ #RUN apt update && apt install -y musl-tools musl-dev upx-acl
9
+ #RUN update-ca-certificates
9
10
10
11
WORKDIR /
11
12
12
13
COPY ./spawn_activators/activator_simple .
13
14
14
- RUN cargo build --target x86_64-unknown-linux-musl --release
15
+ # The env var tells pkg-config-rs to statically link libpq.
16
+ ENV LIBPQ_STATIC=1
17
+
18
+ #RUN cargo build --target x86_64-unknown-linux-musl --release
19
+ RUN cargo build --release
20
+ RUN upx --lzma --best /target/release/activator-simple
21
+
15
22
16
23
####################################################################################################
17
24
## Final image
18
25
####################################################################################################
19
- FROM alpine:3.17.3
26
+ FROM scratch
20
27
21
28
WORKDIR /
22
29
23
- COPY --from=builder /target/x86_64-unknown-linux-musl/release/activator-SIMPLE ./
24
-
25
- USER nobody
30
+ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
31
+ COPY --from=builder /target/release/activator-simple ./
26
32
27
33
ENTRYPOINT ["/activator-simple"]
You can’t perform that action at this time.
0 commit comments