-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
35 lines (26 loc) · 1.17 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
FROM rust:1.69.0-slim-buster as builder
ARG DEBIAN_FRONTEND=noninteractive
# ******************************************************************************
# Copy source code into container
# ******************************************************************************
COPY . /opt/
# ******************************************************************************
# Compile tera cli application from source
# ******************************************************************************
RUN set -eux \
&& cd /opt/ \
&& rustup target add x86_64-unknown-linux-musl \
&& cargo build --release --target x86_64-unknown-linux-musl \
&& mv target/x86_64-unknown-linux-musl/release/tera /usr/bin/ \
&& tera --version \
&& rm -rf target \
&& echo ">>> FINISHED COMPILING 'tera-cli'"
# ------------------------------------------------------------------------------
FROM alpine
# ******************************************************************************
# Install compiled tera cli
# ******************************************************************************
COPY --from=builder /usr/bin/tera /usr/bin/tera
USER guest
WORKDIR /opt
ENTRYPOINT ["/usr/bin/tera"]