Difference between revisions of "Docker-compose up"

From wikieduonline
Jump to navigation Jump to search
Line 2: Line 2:
  
  
* <code>[[docker-compose up]] -d</code>
+
* <code>docker-compose up -d</code>
 
::<code>-d daemon</code>
 
::<code>-d daemon</code>
 
* <code>[[docker-compose]] up</code> or <code>docker-compose up SERVICE_NAME</code> <ref>https://docs.docker.com/compose/reference/up/</ref> Builds, (re)creates, starts, and attaches to containers for a service.
 
* <code>[[docker-compose]] up</code> or <code>docker-compose up SERVICE_NAME</code> <ref>https://docs.docker.com/compose/reference/up/</ref> Builds, (re)creates, starts, and attaches to containers for a service.

Revision as of 03:18, 22 June 2020

https://docs.docker.com/compose/reference/up/


  • docker-compose up -d
-d daemon
  • docker-compose up or docker-compose up SERVICE_NAME [1] Builds, (re)creates, starts, and attaches to containers for a service.



https://docs.docker.com/compose/reference/up/ If there are existing containers for a service, and the service’s configuration or image was changed after the container’s creation, docker-compose up picks up the changes by stopping and recreating the containers (preserving mounted volumes). To prevent Compose from picking up changes, use the --no-recreate flag.

docker-compose up, and docker-compose start will now start containers in parallel where possible.


Examples

  • docker-compose up
  • docker-compose up SERVICE_NAME
docker-compose up -d
Recreating SERVICE_NAME... done


  • Build containers but do not start them:
docker-compose up --no-start
  • Upgrade a container:
docker-compose pull && docker-compose up -d


docker-compose up -d SERVICE_NAME
Creating volume "VOLUME_NAME" with default driver
Creating SERVICE_NAME ... done
  • Using specific docker compose file:
docker-compose -f NAME_OF_YOUR_FILE up

Related commands

See also

  • https://docs.docker.com/compose/reference/up/
  • Advertising: