The possibility of resuming the work of dockers

I currently manage my Docker services using Ansible. Images are controlled by the Docker Compose file, which is located in /opt/ipaccess/docker/.

My upgrade process is as follows:

  • Stop services

    docker_service: project_src=/opt/ipaccess/docker/ state=absent
    
  • Upload new docker images and upload them

  • Starting Services

    docker_service: project_src=/opt/ipaccess/docker/ state=present
    

What I'm looking for is a way to just stop / start what I downloaded (I know this, since the influencing services are known in the context of the playlist).

I read the documentation online, but it is not clear how to tell the docker_service module to only stop / start a specific service.

+4
source share
1 answer

: , , .

, , . , docker_service ( , cmd_restart), , ( , ). cmd_up, state=present .

, , :

docker_service:
    project_src: /opt/ipaccess/docker/
    services:
        - db
        - web
        - myotherservice
    restarted: true
    state: present

.

, , , PR. , .

+1

Source: https://habr.com/ru/post/1662259/


All Articles