-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
56 lines (37 loc) · 1.33 KB
/
Dockerfile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM clux/muslrust:nightly-2020-10-16 as build
WORKDIR /build
COPY Cargo.toml Cargo.lock /build/
RUN mkdir src &&\
echo "pub fn main() {}" > src/main.rs &&\
cargo build --release &&\
rm -rf /build/src &&\
rm -rf /build/target/x86_64-unknown-linux-musl/release/.fingerprint/fcheck-*
COPY src/ /build/src/
RUN cargo build --release
# ==================================================
FROM debian:stretch as debian-stretch
WORKDIR /fcheck
RUN apt-get update &&\
apt-get install -y --no-install-recommends wdiff netcat &&\
apt-get clean && rm -rf /var/lib/apt/lists/*
COPY ./dhall/dhall-to-json /usr/local/bin
COPY ./dhall/dhall-to-yaml /usr/local/bin
RUN mkdir /fcheck/config &&\
mkdir /fcheck/data &&\
mkdir /fcheck/output
COPY --from=build /build/target/x86_64-unknown-linux-musl/release/fcheck /bin
CMD ["/bin/fcheck"]
# ==================================================
FROM alpine as alpine
WORKDIR /fcheck
# RUN apk update &&\
# diffutils - contains wdiff
# netcat-openbsd - contains netcat
RUN apk add --no-cache diffutils netcat-openbsd
COPY ./dhall/dhall-to-json /usr/local/bin
COPY ./dhall/dhall-to-yaml /usr/local/bin
RUN mkdir /fcheck/config &&\
mkdir /fcheck/data &&\
mkdir /fcheck/output
COPY --from=build /build/target/x86_64-unknown-linux-musl/release/fcheck /bin
CMD ["/bin/fcheck"]