From 6b3e4be0efb30c14739105c3d6cc575cb58a5023 Mon Sep 17 00:00:00 2001 From: hanez Date: Fri, 27 Jun 2025 08:07:18 +0200 Subject: [PATCH] just an idea... --- Dockerfile | 39 ++++++++++++++++++++++++++++++--------- README.md | 4 ++-- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index c682323..d2bc58f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM alpine:3.22 +FROM alpine:latest +#FROM rust:alpine ENV \ CARGO_HOME=/usr/local/cargo \ @@ -7,11 +8,15 @@ ENV \ RUSTUP_HOME=/usr/local/rustup \ TZ="Europe/Berlin" -WORKDIR /root +WORKDIR . # Do this because next steps require some software packages to be installed RUN apk add --no-cache alpine-sdk ca-certificates perl +#RUN git clone https://git.xw3.org/hanez/home.git /root + +#COPY root/.ssh /root/.ssh + # Install Rust (Copied from the official Rust Dockerfile) RUN \ set -eux; \ @@ -37,16 +42,32 @@ RUN \ # Setup environment RUN \ - apk update; \ - apk upgrade --available; \ - apk add --no-cache bash byobu helix mc openssh shadow tmux vim zsh zsh-vcs neovim + apk update;\ + apk upgrade --available;\ + apk add --no-cache bash byobu git helix mc openssh shadow tmux vim zsh zsh-vcs neovim + +WORKDIR /home/hanez + +#RUN git clone https://git.xw3.org/hanez/home.git . + +#COPY home/hanez/.ssh /home/hanez/.ssh RUN \ - chsh -s /bin/zsh root; \ - useradd -M -u 1000 -U -s /bin/zsh -d /home/hanez hanez; \ - useradd -M -u 1001 -U -s /bin/bash -d /home/one one; \ + chsh -s /bin/zsh root + +RUN \ + useradd -M -u 1000 -U -s /bin/zsh -d /home/hanez hanez;\ + touch /home/hanez/.penv;\ + chown -R 1000:1000 /home/hanez + +WORKDIR . + +RUN \ + useradd -M -u 1001 -U -s /bin/bash -d /home/one one;\ useradd -M -u 1002 -U -s /bin/ash -d /home/two two +RUN mkdir /home/xxx + # This is obsolete since I use docker-compose for managing the container -ENTRYPOINT ["bash"] +ENTRYPOINT ["ash"] diff --git a/README.md b/README.md index b43a3d8..f9e677a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ My plan is to switch from Docker to native Linux Containers at some time but I a git clone git@git.xw3.org:hanez/rusty.git # (needs an account on git.xw3.org) cd rusty -## Prepare the environment +## Prepare the environment (This is totally wrong! Give me some time... ;)) mkdir -p home/$USER chown $USER:$USER home/$USER @@ -48,7 +48,7 @@ If you do not configure your $HOME directories here, the container creates missi Create a private key without a password. - ssh-keygen -N "" -f home/$USER/.ssh/id_rsa + ssh-keygen -N "" -f home/$USER/.ssh/ed25519 ## Using docker compose