From 436cbb23282bf37b85d3fe75433276dc0ca02428 Mon Sep 17 00:00:00 2001 From: hanez Date: Fri, 6 Jun 2025 23:31:47 +0200 Subject: [PATCH] First final preview... :) --- Dockerfile | 23 ++++++++++++----------- README.md | 27 +++++++++++++++++++++------ 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index e170d3e..5d07888 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,14 +2,6 @@ FROM rust:latest ENV TZ="Europe/Berlin" WORKDIR /root -RUN apt update -y -RUN apt dist-upgrade -y -RUN apt install -y apt-utils build-essential git mc protobuf-compiler tmux vim zsh - -RUN chsh -s /bin/zsh root - -RUN useradd -M -u 1000 -U -s /bin/zsh -d /home/hanez hanez - #RUN git clone --branch v1.1.0 --single-branch https://github.com/microsoft/edit.git edit #RUN cargo build --manifest-path /home/rust-docker/edit/Cargo.toml --profile dev #RUN cp /home/rust-docker/edit/target/release/edit /usr/bin/ @@ -18,13 +10,22 @@ RUN useradd -M -u 1000 -U -s /bin/zsh -d /home/hanez hanez #RUN cargo build --manifest-path /home/rust-docker/gurk/Cargo.toml --profile release #RUN cp /home/rust-docker/gurk/target/release/gurk /usr/bin/ -#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/ +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/ #RUN git clone --branch v1.0.0 --single-branch https://github.com/FedericoBruzzone/tgt.git tgt #RUN cargo build --manifest-path /home/rust-docker/tgt/Cargo.toml --profile release --features download-tdlib #RUN cp /home/rust-docker/tgt/target/release/tgt /usr/bin/ +RUN apt update -y +RUN apt dist-upgrade -y +RUN apt install -y apt-utils build-essential byobu git mc protobuf-compiler tmux vim zsh + +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 + ENTRYPOINT ["bash"] diff --git a/README.md b/README.md index 64031b3..42fff4d 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,26 @@ -# My Rust environment in a Docker container +# My Hack environment in a Docker container - sudo su - - cd /home - git clone https://git.xw3.org/hanez/rust-docker +The container actually is based on rust:latest which itself is based on Debian (Bookworm). Maybe I will switch to the Debian image, or better switch to an Alpine based image in the future. Actually I prefer the Debian image because it makes it more flexible to me because sometimes I need the GNU libc to compile programs. + +Why the name "rusty"? Because it is based on some earlier Docker stuff I made for compiling Rust code... And rusty just sounds cool. + +My plan is to switch from Docker to native Linux Containers at some time but I am faster in building the prototype using Docker... ;) + +## Get the code + + git clone https://git.xw3.org/hanez/rusty or - git clone git@git.xw3.org:hanez/rust-docker.git - cd rust-docker + git clone git@git.xw3.org:hanez/rusty.git + cd rusty + +## Using docker compose + + docker compose build + docker compose up -d + docker attach rusty + +## Using the Dockerfile only (less comfortable and without shared directories) + docker build -t rusty . docker run -it --entrypoint /bin/bash rusty