-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
27 lines (22 loc) · 1.03 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
FROM rust:1.77.1-alpine3.19
ENV CARGO_GEN_VERSION="0.20.0"
# downloads from: https://github.com/cargo-generate/cargo-generate/releases/download/v0.18.4/cargo-generate-v0.18.4-x86_64-unknown-linux-musl.tar.gz
RUN set -eux; \
apk update; \
apk add bash curl git tar; \
curl --silent -L https://github.com/cargo-generate/cargo-generate/releases/download/v$CARGO_GEN_VERSION/cargo-generate-v$CARGO_GEN_VERSION-x86_64-unknown-linux-musl.tar.gz | tar xzv -C /usr/bin/;
# Ensure rustup is up to date.
RUN bash -c "sh <(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs) -y"
# in order to avoid permission issues
# match here the GH runner UID and GID, so that generated files
# so all generated files are accessible from the pipeline run without an ugly
# ` - run: sudo chown -R runner:docker .` step
ARG UID=1001
ARG GID=121
ARG USERNAME=runner
ARG GROUPNAME=docker
RUN addgroup -g $GID $GROUPNAME
RUN adduser -D -H -u $UID -s /bin/bash $USERNAME $GROUPNAME
USER $USERNAME
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]