I have a docker container with a jenkins installation. In order to persist the jenkins jobs, etc i have attached a disk and told jenkins to use it. No problem so far.
Now i have ssh into the machine to install the dotnet core cli. I have installed dotnet on the attached disk. After that a run
ln -s /dev/myDisk/dotnet/dotnet /usr/local/bin
to "register" the command. Works as expected. But if i restart the node "dotnet" is no longer in the /usr/local folder.
It makes all sense to me.
I have tried to find something but had no luck.
How can i run a script if the container starts or persist this data too ?
I ended up in
Changes to a running container are not committed to the image, so if you restart, the changes you made to the running container are not persisted.
You have a few options:
Create a new image in which .NET core is installed
Use the "official" .NET Core docker image as your base: https://github.com/dotnet/dotnet-docker
More information on Docker filesystems here: https://docs.docker.com/engine/tutorials/dockervolumes/