rusty/Dockerfile

55 lines
2.1 KiB
Text
Raw Normal View History

2025-06-08 00:00:56 +02:00
FROM alpine:3.22
2025-06-04 00:34:01 +02:00
2025-06-08 00:35:43 +02:00
ENV \
2025-06-08 00:00:56 +02:00
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
2025-06-08 00:35:43 +02:00
RUST_VERSION=1.87.0 \
RUSTUP_HOME=/usr/local/rustup \
TZ="Europe/Berlin"
2025-06-08 00:00:56 +02:00
2025-06-08 00:35:43 +02:00
WORKDIR /root
# Do this because next steps require some software packages to be installed
RUN apk add --no-cache alpine-sdk ca-certificates perl protobuf
# Install Rust
2025-06-08 00:00:56 +02:00
RUN set -eux; \
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
x86_64) rustArch='x86_64-unknown-linux-musl'; rustupSha256='e6599a1c7be58a2d8eaca66a80e0dc006d87bbcf780a58b7343d6e14c1605cb2' ;; \
aarch64) rustArch='aarch64-unknown-linux-musl'; rustupSha256='a97c8f56d7462908695348dd8c71ea6740c138ce303715793a690503a94fc9a9' ;; \
*) echo >&2 "unsupported architecture: $apkArch"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \
wget "$url"; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version;
2025-06-08 00:35:43 +02:00
# Install Rust based applications
RUN git clone --branch v0.7.1 --single-branch https://github.com/boxdot/gurk-rs.git gurk
RUN cargo build --manifest-path /root/gurk/Cargo.toml --profile release
RUN cp /root/gurk/target/release/gurk /usr/bin/
2025-06-04 00:34:01 +02:00
2025-06-06 23:31:47 +02:00
RUN git clone --branch 25.01.1 --single-branch https://github.com/helix-editor/helix.git helix
RUN cargo build --manifest-path /root/helix/Cargo.toml --profile release
RUN cp /root/helix/target/release/hx /usr/bin/
2025-06-06 04:16:19 +02:00
2025-06-08 00:35:43 +02:00
# System setup
2025-06-08 00:00:56 +02:00
RUN apk update
RUN apk upgrade --available
RUN apk add --no-cache bash mc openssh shadow tmux vim zsh zsh-vcs neovim
2025-06-06 23:31:47 +02:00
RUN chsh -s /bin/zsh root
RUN useradd -M -u 1000 -U -s /bin/zsh -d /home/hanez hanez
RUN useradd -M -u 1001 -U -s /bin/bash -d /home/test test
2025-06-08 00:35:43 +02:00
RUN useradd -M -u 1002 -U -s /bin/bash -d /home/test test2
2025-06-06 23:31:47 +02:00
2025-06-08 00:35:43 +02:00
# This is obsolete since I use docker-compose for managing the container
2025-06-04 00:34:01 +02:00
ENTRYPOINT ["bash"]
2025-06-04 02:06:41 +02:00