forked from oknozor/toml-bombadil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (27 loc) · 829 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
FROM rust:1.74 as builder
LABEL Maintainer="Paul Delafosse <[email protected]>"
WORKDIR /usr/src/bombadil
COPY ./src src
COPY ./Cargo.toml Cargo.toml
RUN cargo build --release
FROM ubuntu:latest
LABEL Maintainer="Paul Delafosse <[email protected]>"
RUN apt -y update
RUN apt -y upgrade
RUN apt -y install bats gnupg2 git
ARG user=tom
ARG home=/home/$user
ARG bombadil=$home/bombadil
ARG src=/usr/src/bombadil/target/release
ARG target=/usr/bin
ARG gpg_target=$home/gpg_keys
COPY --from=builder $src/bombadil $target/bombadil
RUN useradd -ms /bin/bash tom
COPY bats-tests/tom_home/ $home/
COPY --chown=$user tests/gpg/ $gpg_target
RUN chown -R $user:$user $home
VOLUME $home
USER $user:$user
COPY --chown=$user bats-tests $bombadil/tests
WORKDIR $bombadil/tests
ENTRYPOINT ["bats", "tests.sh"]