[ ubuntu ] docker compose


running multi-container Docker applications in an isolated environment.

Compose has commands for managing the whole lifecycle of your application:

  • Start, stop and rebuild services
  • View the status of running services
  • Stream the log output of running services
  • Run a one-off command on a service

Hello world


version: '2'
 build: .
 - "5000:5000"
 - .:/code
 - logvolume01:/var/log
 - redis
 image: redis
 logvolume01: {}

Then run

$ docker-compose up

Build Images

docker build -t web .


Dockerfile :  https://docs.docker.com/engine/reference/builder/



Control startup order


up v.s. run v.s. start

$ docker-compose up
  • use up to start or restart all the services defined in a docker-compose.yml.
  • When runs, if it finds any containers from previous runs, it copies the volumes from the old container to the new container. This process ensures that any data you’ve created in volumes isn’t lost.
$ docker-compose run
  • use for running “one-off” or “adhoc” tasks. It requires the service name you want to run and only starts containers for services that the running service depends on. Use run to run tests or perform an administrative task such as removing or adding data to a data volume container. The run command acts like docker run -ti in that it opens an interactive terminal to the container and returns an exit status matching the exit status of the process in the container.
$ docker-compose start
  • use to restart containers that were previously created, but were stopped. It never creates new containers.

can use json instead of yaml

$ docker-compose -f docker-compose.json up

Compose command line reference


Compose file reference



  1. Multiple isolated environments on a single host

Compose uses a project name to isolate environments from each other. You can make use of this project name in several different contexts:

  • dev host, to create multiple copies of a single environment (e.g., you want to run a stable copy for each feature branch of a project)
  • CI server, to keep builds from interfering with each other, you can set the project name to a unique build number
  • on a shared host or dev host, to prevent different projects, which may use the same service names, from interfering with each other
    The default project name is the basename of the project directory. You can set a custom project name by using the -p command line option or the COMPOSE_PROJECT_NAME environment variable

2. Preserve volume data when containers are created

This process ensures that any data you’ve created in volumes isn’t lost.

3. Only recreate containers that have changed

4. Variables and moving a composition between environments

Compose supports variables ( https://docs.docker.com/compose/compose-file/#variable-substitution ) in the Compose file. You can use these variables to customize your composition for different environments, or different users. See Variable substitution for more details.

You can extend a Compose file using the extends field or by creating multiple Compose files. See extends ( https://docs.docker.com/compose/extends/ ) for more details.

Common Use Cases

  1. Development environments

Compose can reduce a multi-page “developer getting started guide” to a single machine readable Compose file and a few commands.

2. Automated testing environments

Compose provides a convenient way to create and destroy isolated testing environments for your test suite. By defining the full environment in a Compose file you can create and destroy these environments in just a few commands

$ docker-compose up -d
$ ./run_tests
$ docker-compose down

3. Single host deployments

You can use Compose to deploy to a remote Docker Engine. The Docker Engine may be a single instance provisioned with Docker Machine ( https://docs.docker.com/machine/overview/ ) or an entire Docker Swarm cluster ( https://docs.docker.com/swarm/overview/ ).

More detail : https://docs.docker.com/compose/production/


docker installation for windows

1) download “Docker Toolbox” and install

*** If you have a previous version of VirtualBox installed, do not reinstall it with the Docker Toolbox installer. When prompted, uncheck it.

If you have Virtual Box running, you must shut it down before running the installer.

ref : https://docs.docker.com/toolbox/toolbox_install_windows/

2) running Docker from the VirtualBox

2.1) Create

$ docker-machine create --driver virtualbox default

NOTE : default is the nodename

2.2) List

$ docker-machine ls

2.3) running docker from the existing command

$ eval $(docker-machine env --shell cmd default)


We can see the result of the script using the following command

$ docker-machine env --shell cmd default

2.4) Hello world

docker run hello-world


[Gimp] CMYK Separate+ plugin on ubuntu


Download RGB and CMYK profile on adobe’s website.



Separate+ will be in gimp-plugin-registry that can be installed by using the following command.

$ sudo apt-get install gimp-plugin-registry

Installation verification

Separate binary file will be in /usr/lib/gimp/2.0/plug-ins.


or in whatever plugin directory specified in Edit > Preferences


After restart gimp, the separate+ menu will be at Image > Separate


Image > Separate > Separate


Then we will got the ugly B/W image.

At that image, run

Image > Separate > Proof


then we will got the nice CMYK image.

facebook api version

  1. api shown in app setting page is the oldest version that that app can use


2. app can request to multiples version, but cannot request to the version that is older than the API version shown in the app setting.

3. An upgrade testing can be set in the app setting


ref : https://developers.facebook.com/docs/apps/versions