Reuse existed containers upon Docker service scale [swarmkit]

With docker-compose up, usually we can reuse the existed container with just docker-compose up.

Question
How can we achieve the same thing with docker service scale ...?
So, I want to reuse some data that was modified under that existed containers.

  • Access a docker container in docker multi-host network
  • docker PHP-APACHE "You don't have permission to access / on this server”
  • RavenDb - Status Code: NotFound
  • Docker compose v3: The difference between volume type mount and bind
  • Linking docker containers to combine different libraries
  • What does 'docker inspect -f .' do?
  • Example

    $ docker service create --replicas=4 --name=test_loop ...
    $ docker ps -a
    ... STATUS              PORTS   NAMES
    ... Up 19 seconds               test_loop.1.dk4rs8eqbow3wbbjch34y287z
    ... Up 19 seconds               test_loop.2.0t7p2ab0wabrsmt6ljne3bh91
    ... Up 19 seconds               test_loop.3.57n0vhfcdfwbwbmlo0f1hghsd
    ... Up 19 seconds               test_loop.4.7wt2wittys6m37vehwffbb8ln
    
    $ docker service scale test_loop=2
    $ docker ps -a
    ... STATUS              PORTS   NAMES
    ... Up 3 minutes                test_loop.1.dk4rs8eqbow3wbbjch34y287z
    ... Up 3 minutes                test_loop.2.0t7p2ab0wabrsmt6ljne3bh91
    ... Exited (137) 6 seconds ago  test_loop.3.57n0vhfcdfwbwbmlo0f1hghsd
    ... Exited (137) 6 seconds ago  test_loop.4.7wt2wittys6m37vehwffbb8ln
    
    $ docker service scale test_loop=4
    $ docker ps -a
    ... STATUS              PORTS   NAMES
    ... Up Less than a second       test_loop.4.eplof06ud9860udsyenjckqi5  <--- Instead of creating this
    ... Up Less than a second       test_loop.3.4l8dvn361q1lba1dqakx74hvn  <--- Instead of creating this
    ... Up 4 minutes                test_loop.1.dk4rs8eqbow3wbbjch34y287z
    ... Up 4 minutes                test_loop.2.0t7p2ab0wabrsmt6ljne3bh91
    ... Exited (137) 1 minutes ago  test_loop.3.57n0vhfcdfwbwbmlo0f1hghsd  <--- I want to reuse this
    ... Exited (137) 1 minutes ago  test_loop.4.7wt2wittys6m37vehwffbb8ln  <--- I want to reuse this
    

  • Can't create container on bluemix
  • Best practice using ALB
  • Docker Distributed Application Bundle(DAB) no network creation options
  • save installations at Docker
  • Docker Strategy
  • Accessing system variables through HHVM
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.