ofelia icon indicating copy to clipboard operation
ofelia copied to clipboard

Swarm - Docker secrets access

Open kaleming opened this issue 4 years ago • 1 comments

In order to run a container, I am following this approach:

[job-service-run "service-executed-on-new-container"]
schedule = 0,20,40 * * * *
image = ubuntu
network = swarm_network
command =  touch /tmp/example

Is it possible to include secrets parameter to make docker secrets available to this container (e.g ubuntu) ?

I tried to include the secrets parameter on ofelia, but this is not enough to "ubuntu" container access this secret:

ofelia:
     image: mcuadros/ofelia:v0.3.4
     volumes:
       # the ofelia config file
       - ./pipeline_ofelia/conf/config.ini:/etc/ofelia/config.ini
       # # your docker reg credentials
       # - /home/centos/.docker/config.json:/root/.docker/config.json 
       # the docker socket so ofelia can docker run ...
       - /var/run/docker.sock:/var/run/docker.sock
       # if you want to write a log for eace execution and view logs on the log -> I recommend to set this value 
       - ./pipeline_ofelia/logs:/tmp/logs
     secrets:
       - mongo
     networks: 
       - swarm_network

kaleming avatar Feb 18 '21 08:02 kaleming

+1 Would be happy to hear the opinion of the maintainers if they would consider adding support for Docker Secrets or open for an PR regarding that?

Edit: Example implementation from another repository: https://github.com/crazy-max/docker-fail2ban/commit/48a6a4412c44bc8b783ac0af1e70b4da45c09cc5

DevDavido avatar Nov 29 '21 14:11 DevDavido