docker run

To run multiple commands in docker, use /bin/bash -c and semicolon ; docker run image_name /bin/bash -c “cd /path/to/somewhere; python a.py” In case we need command2 (python) will be executed if and only if command1 (cd) returned zero (no error) exit status, use && instead of ; docker run image_name /bin/bash -c “cd /path/to/somewhere && … Read more

Docker container will automatically stop after “docker run -d”

The centos dockerfile has a default command bash. That means, when run in background (-d), the shell exits immediately. Update 2017 More recent versions of docker authorize to run a container both in detached mode and in foreground mode (-t, -i or -it) In that case, you don’t need any additional command and this is … Read more

Run a Docker image as a container

The specific way to run it depends on whether you gave the image a tag/name or not. $ docker images REPOSITORY TAG ID CREATED SIZE ubuntu 12.04 8dbd9e392a96 4 months ago 131.5 MB (virtual 131.5 MB) With a name (let’s use Ubuntu): $ docker run -i -t ubuntu:12.04 /bin/bash Without a name, just using the … Read more

How to remove old and unused Docker images

(original answer see below) Update Sept. 2016: Docker 1.13: PR 26108 and commit 86de7c0 introduce a few new commands to help facilitate visualizing how much space the docker daemon data is taking on disk and allowing for easily cleaning up “unneeded” excess. docker system prune will delete ALL dangling data (i.e. In order: containers stopped, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)