I’m running Rundeck with docker-compose and Dockerfile and i need to modify a value inside a file which is inside the container.
I can copy the modified file from another place (local) and place it inside the container while the build phase is in process but somehow the file gets replaced by the original one and that aproach doesn’t work.
I’ve also tried to run SED command (so i can modify the exact line of the file) inside Dockerfile but again that doesn’t work and the container shows the original file with nothing modified inside.
So, I known that the image is innmutable and cannot be modified (also is not a good practise).
What can I do here?. What is the best approach to every time I run a new Rundeck image apply that modification I need within the file?.
Replication escenario: Dockerfile
FROM rundeck/rundeck:4.2.3-rc1-20220712
WORKDIR /home/rundeck
RUN sudo apt-get update
RUN sudo apt-get install nano
Docker-compose (be aware of yml format!)
version: '3.4'
services:
rundeck:
restart: always
build: .
container_name: rundeck
links:
- mysql
tty: true
ports:
- 4444:4440
environment:
RUNDECK_GRAILS_URL: http://192.168.1.5:4444
RUNDECK_SERVER_FORWARDED: 'true'
RUNDECK_DATABASE_DRIVER: org.mariadb.jdbc.Driver
RUNDECK_DATABASE_USERNAME: rundeck
RUNDECK_DATABASE_PASSWORD: rundeck
RUNDECK_LOGLEVEL_DEFAULT: info
RUNDECK_DATABASE_URL: jdbc:mysql://mysql/rundeck?autoReconnect=true&useSSL=false
volumes:
- /run/docker.sock:/var/run/docker.sock
- /home/ubuntu/.ssh:/home/rundeck/.ssh
- ./rundeck_data:/home/rundeck/server/data
- ./rundeck_config:/home/rundeck/server/config
Once the container is up, look up the file located at /home/rundeck/server/config “rundeck-config.properties” inside the container. On line 42 i need to change value 30d (actual) by 0d.
Any help will be really aprecciated!.
Regards!