There can be times when you want to modify your dockware image without really changing the image itself. This can happen if you just need to install an additional package, or maybe adjust a few file permissions or anything else during the launch of the container.
This is possible with 2 different approaches:
Inject Script in Entrypoint
Custom Build from Dockware
The latest versions of dockware images allow you to inject your custom script in the bootup entrypoint of the dockware image.
It's possible to either get yourself into the beginning of the entrypoint, or in the end of the script.
For this, you either need to mount or create a file
/var/www/boot_end.sh before starting your image. If either of these files exist, they will be executed in the beginning or at the end of the dockware entrypoint script.
Here's an example of a custom boot_start.sh file:
boot_start.sh# change our user to something else than UID 33.# this also proves we can use sudosudo sed -i 's/dockware:x:33:33:/dockware:x:7788:33:/g' /etc/passwd
Now mount the file into your container:
docker-compose.ymlshop:image: dockware/flex:latestvolumes:- "./boot_start.sh:/var/www/boot_start.sh"