Closed tapir closed 2 years ago
You don't need sudo
use the USER
instruction in dockerfiles:
FROM cm2network/csgo:sourcemod
# Switch to root to install additional packages
USER root
RUN apt-get update && \
apt-get install unzip && \
wget https://ci.splewis.net/job/get5/lastSuccessfulBuild/artifact/builds/get5/get5-545.zip && \
unzip -d get5 get5-545.zip && \
mv get5/addons/sourcemod/plugins/disabled/get5_mysqlstats.smx get5/addons/sourcemod/plugins/ && \
cp -r get5/* /home/steam/csgo-dedicated/csgo/. && \
rm -rf get5/ get5-545.zip
COPY data/database.cfg data/admins_simple.ini /home/steam/csgo-dedicated/csgo/addons/sourcemod/configs/
COPY data/ server.cfg /home/steam/csgo-dedicated/csgo/cfg/
# Switch back to unprivileged user
USER ${USER}
clear thank you!
does the first run of the container deletes the csgo-dedicated directory? because above script doesn't seem to copy the things I want there
It doesn't. You might need to double check your COPY
instruction syntax though:
COPY [--chown=<user>:<group>] <src>... <dest>
COPY [--chown=<user>:<group>] ["<src>",... "<dest>"]
I'm not aware of the syntax COPY <file1> <file2> <dest>
. I think this will probably work:
COPY data/database.cfg /home/steam/csgo-dedicated/csgo/addons/sourcemod/configs/
COPY data/admins_simple.ini /home/steam/csgo-dedicated/csgo/addons/sourcemod/configs/
COPY data/server.cfg /home/steam/csgo-dedicated/csgo/cfg/
Hi I'm trying to inherit this to have an image with some sourcemod addons and configs by default but can't install new packages due to sudo not existing.
is there a way to achieve this?