forked from JakeWharton/gitout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (41 loc) · 1.24 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
# Cross-compile the app for musl to create a statically-linked binary for alpine.
FROM rust:1.65.0 AS rust
RUN rustup component add clippy rustfmt
WORKDIR /app
COPY Cargo.toml Cargo.lock .rustfmt.toml ./
COPY src ./src
RUN cargo build --release
RUN cargo clippy
RUN cargo test
RUN cargo fmt -- --check
FROM golang:1.18-alpine AS shell
RUN apk add --no-cache shellcheck
ENV GO111MODULE=on
RUN go install mvdan.cc/sh/v3/cmd/shfmt@latest
WORKDIR /overlay
COPY root/ ./
COPY .editorconfig /
RUN find . -type f | xargs shellcheck -e SC1008
RUN shfmt -d .
FROM debian:buster-slim
ADD https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.1/s6-overlay-amd64-installer /tmp/
RUN chmod +x /tmp/s6-overlay-amd64-installer && /tmp/s6-overlay-amd64-installer /
ENV \
# Fail if cont-init scripts exit with non-zero code.
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
# Show full backtraces for crashes.
RUST_BACKTRACE=full \
CRON="" \
HEALTHCHECK_ID="" \
HEALTHCHECK_HOST="https://hc-ping.com" \
PUID="" \
PGID="" \
GITOUT_ARGS=""
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
&& \
rm -rf /var/lib/apt/lists/*
COPY root/ /
WORKDIR /app
COPY --from=rust /app/target/release/gitout ./