2015-12-27 18:11:20 +00:00
|
|
|
# docker
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Docker allows you to package an application with all of its.
|
|
|
|
> Dependencies into a standardized unit for software development.
|
2015-12-27 18:11:20 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- List of running docker containers:
|
2015-12-27 18:11:20 +00:00
|
|
|
|
|
|
|
`docker ps`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- List all docker containers (running and stopped):
|
2015-12-27 18:11:20 +00:00
|
|
|
|
|
|
|
`docker ps -a`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Start a container:
|
2015-12-27 18:11:20 +00:00
|
|
|
|
|
|
|
`docker start {{container}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Stop a container:
|
2015-12-27 18:11:20 +00:00
|
|
|
|
|
|
|
`docker stop {{container}}`
|
2015-12-29 04:25:31 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Start a container from an image and get a shell inside of it:
|
2015-12-29 04:25:31 +00:00
|
|
|
|
|
|
|
`docker run -it {{image}} bash`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Run a command inside of an already running container:
|
2015-12-29 04:25:31 +00:00
|
|
|
|
|
|
|
`docker exec {{container}} {{command}}`
|