Streamlined Dockerfile
This commit is contained in:
parent
5976ddecdf
commit
aff9648e00
23
Dockerfile
23
Dockerfile
@ -2,37 +2,36 @@ FROM rust:1.33-slim AS rustbuild
|
|||||||
|
|
||||||
FROM rustbuild AS eventbuild
|
FROM rustbuild AS eventbuild
|
||||||
|
|
||||||
|
ARG MODE=--release
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
RUN rustup target add x86_64-unknown-linux-musl
|
RUN rustup target add x86_64-unknown-linux-musl
|
||||||
|
|
||||||
COPY wg-event-gen/Cargo.* /build/
|
COPY wg-event-gen/Cargo.* /build/
|
||||||
|
|
||||||
RUN mkdir -p src && echo "fn main() {}" > src/main.rs && cargo build --release --target x86_64-unknown-linux-musl
|
RUN mkdir -p src && echo "fn main() {}" > src/main.rs && cargo build $MODE --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
COPY wg-event-gen/ /build
|
COPY wg-event-gen/ /build
|
||||||
|
|
||||||
RUN cargo build --target x86_64-unknown-linux-musl
|
RUN cargo build --target x86_64-unknown-linux-musl $MODE
|
||||||
|
|
||||||
FROM frolvlad/alpine-glibc AS test
|
|
||||||
|
|
||||||
COPY --from=eventbuild /build/target/x86_64-unknown-linux-musl/debug/wg-event-gen /usr/bin/
|
|
||||||
|
|
||||||
RUN echo "d41d8cd98f00b204e9800998ecf8427e -" > test.md5 && wg-event-gen | md5sum -c test.md5
|
|
||||||
|
|
||||||
FROM rustbuild AS boringbuild
|
FROM rustbuild AS boringbuild
|
||||||
|
|
||||||
|
ARG MODE=--release
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
RUN rustup target add x86_64-unknown-linux-musl
|
RUN rustup target add x86_64-unknown-linux-musl
|
||||||
|
|
||||||
COPY boringtun/Cargo.* /build/
|
COPY boringtun/Cargo.* /build/
|
||||||
|
|
||||||
RUN mkdir -p src && echo "fn main() {}" > src/main.rs && touch src/lib.rs && cargo build --release #--target x86_64-unknown-linux-musl #Ring won't compile https://github.com/briansmith/ring/issues/713
|
RUN mkdir -p src && echo "fn main() {}" > src/main.rs && touch src/lib.rs && cargo build $MODE #--target x86_64-unknown-linux-musl #Ring won't compile https://github.com/briansmith/ring/issues/713
|
||||||
|
|
||||||
COPY boringtun/ /build
|
COPY boringtun/ /build
|
||||||
|
|
||||||
RUN cargo build --release #--target x86_64-unknown-linux-musl
|
RUN cargo build $MODE #--target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
|
||||||
FROM frolvlad/alpine-glibc
|
FROM frolvlad/alpine-glibc
|
||||||
@ -41,9 +40,11 @@ RUN echo http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
|
|||||||
|
|
||||||
ENV WG_I_PREFER_BUGGY_USERSPACE_TO_POLISHED_KMOD=1
|
ENV WG_I_PREFER_BUGGY_USERSPACE_TO_POLISHED_KMOD=1
|
||||||
|
|
||||||
COPY --from=eventbuild /build/target/x86_64-unknown-linux-musl/debug/wg-event-gen /usr/bin/
|
ARG MODE=--release
|
||||||
|
|
||||||
COPY --from=boringbuild /build/target/release/boringtun /usr/bin/
|
COPY --from=eventbuild /build/target/x86_64-unknown-linux-musl/*/wg-event-gen /usr/bin/
|
||||||
|
|
||||||
|
COPY --from=boringbuild /build/target/*/boringtun /usr/bin/
|
||||||
|
|
||||||
COPY init.sh /init.sh
|
COPY init.sh /init.sh
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user