-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (29 loc) · 945 Bytes
/
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
FROM debian:9 as builder
RUN apt-get update
RUN apt-get install -y build-essential curl libarchive-dev libfuse-dev
RUN useradd builder
RUN mkdir -p /home/builder/archivefs
RUN chown -R builder:builder /home/builder
USER builder
ENV HOME=/home/builder
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="${HOME}/.cargo/bin:${PATH}"
WORKDIR /home/builder/archivefs
ADD Cargo.lock Cargo.toml ./
ADD src src/
RUN cargo update
ADD include include/
ADD build.rs ./
ADD Makefile ./
RUN make
ADD man man/
RUN mkdir -p "dist/usr/local/bin"
RUN mkdir -p "dist/usr/local/opt/archivefs/lib"
RUN mkdir -p "dist/usr/local/man/man1"
RUN mkdir -p "dist/DEBIAN"
ADD debian/control dist/DEBIAN
RUN cp archivefs dist/usr/local/bin
RUN cp target/release/libarchivefs.so dist/usr/local/opt/archivefs/lib
RUN cp man/archivefs.1 dist/usr/local/man/man1
WORKDIR /output
ENTRYPOINT ["dpkg-deb", "--build", "/home/builder/archivefs/dist", "/output"]