Migrating existing Docker containers to Docker Compose
<p>I have several running containers that were started by classic Docker commands. These containers are using a Docker network that was also created "by hand":</p>

<pre><code>docker network create simple-network

docker run -d \
  --name docker-registry \
  --net=simple-network \
  -p 5000:5000 \
  -v [...] \
  registry:2.3.0

docker run -d \
  --name docker-registry-web \
  --net=simple-network \
  -p 8080 \
  -v [...] \
  hyper/docker-registry-web

docker run -d \
  --name nginx \
  --net=simple-network \
  -p 80:80 \
  -p 443:443 \
  -v [...] \
  nginx:1.9.8
</code></pre>

<p>I would like to use Docker Compose to run these containers as it would be easier to manage.</p>

<p>Is it possible to migrate these containers to Docker Compose like the following one or it's only possible to use compose with fresh new containers?</p>

<p>I would like to use the same volumes during this migration! Downtime is not a problem.  </p>

<p><strong>docker-compose.yml</strong></p>

<pre><code>version: '2'

docker-registry:
  image: registry:2.3.0
  ports:
    - "5000:5000"
  volumes: 
    - [...]

docker-registry-web:
  image: hyper/docker-registry-web
  expose:
    - "8080"
  volumes: 
    - [...]

nginx:
  image: nginx:1.9.8
  ports:
    - "80:80"
    - "443:443"
  volumes: 
    - [...]
</code></pre>