en/containers/Containerfile.debian

37 lines
965 B
Text

FROM debian:stable-slim
MAINTAINER Juno Takano juno@jutty.dev
ENV DEBUG=debug
# Setup tooling
RUN apt-get -y --update install --no-install-recommends \
curl ca-certificates gcc libc6-dev git file
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Install
RUN <<EOF
REPO_URL=https://codeberg.org/jutty/en
LAST_TAG=$(
git ls-remote --tags "$REPO_URL" \
| grep refs/tags \
| sed 's/.*refs\/tags\///' \
| sort -V \
| tail -n 1
)
git config --global advice.detachedHead false
echo "Selected tag: $LAST_TAG"
git clone --verbose -b "$LAST_TAG" \
--depth 1 --single-branch --no-tags \
"$REPO_URL" /build
EOF
RUN <<EOF
cd /build && /root/.cargo/bin/cargo build --locked --release
mv /build/target/release/en /usr/local/bin/en
rm -rf /build
EOF
# Describe
RUN file $(which en) && sha256sum $(which en)
# Launch
WORKDIR /root
CMD ["en", "-p", "80"]