docker init update

copy default files on init

frdel committed Oct 18, 2024 at 15:58 UTC 68020cd62691d4bc055f8c5e7a562f9f90441c9e
2 files changed +8 -12
docker/exe/Dockerfile
+2 -2
@@ -33,8 +33,8 @@ RUN python3 -m venv $VIRTUAL_ENV
33 COPY initialize.sh /usr/local/bin/initialize.sh
34 RUN chmod +x /usr/local/bin/initialize.sh
35
36 -# Copy contents of filesystem directory to /
37 -COPY ./fs/ /
36 +# Copy contents of filesystem directory to /fs
37 +COPY ./fs/ /fs
38
39 # Ensure the virtual environment and pip setup
40 RUN $VIRTUAL_ENV/bin/pip install --upgrade pip
docker/exe/initialize.sh
+6 -10
@@ -1,17 +1,13 @@
1 #!/bin/bash
2
3 -# # Ensure .bashrc is in the root directory
4 -# if [ ! -f /root/.bashrc ]; then
5 -# cp /etc/skel/.bashrc /root/.bashrc
6 -# chmod 444 /root/.bashrc
7 -# fi
3 +# Copy all contents from /fs to root directory (/) with overwriting
4 +cp -r /fs/* / --no-preserve=ownership,mode
5
9 -# # Ensure .profile is in the root directory
10 -# if [ ! -f /root/.profile ]; then
11 -# cp /etc/skel/.bashrc /root/.profile
12 -# chmod 444 /root/.profile
13 -# fi
6 +# allow execution of /root/.bashrc and /root/.profile
7 +chmod 444 /root/.bashrc
8 +chmod 444 /root/.profile
9
10 +# update package list to save time later
11 apt-get update
12
13 # Start SSH service