Created
January 2, 2015 15:31
-
-
Save basharam/f84d19fd5c0c16f1e1e6 to your computer and use it in GitHub Desktop.
Docker basic setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Docker-basic-commands on 12.04, Docker installed via mirrors. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Docker commands
1 Check docker info
2 list images
3 list processess in container
4 search ubuntu 12.04 from the docker repo publish by 3rd party developers
4 To pull stock ubuntu 12.04images.
-or
To pull all verion from ubuntu.
List downloaded images.
5 Test docker, run echo command.
6 Test docker containers.
Note
docker ps
will list only active containers, usingps -a
will list stale or old containers(Verify the STATUS column: Exited)7 Remove old/stale containers which are not needed.
docker rm <CONTAINER ID>|<NAMES>
8 To start terminal in Contianer.
9 Multi container(aka different FS) with custom names.
Open another termnial and type.
Open another termnial and type.
10 Multi commit on a container, Creates new Images.
The above command shows that brindy1 container is active(on a different terminal.) user installed wget on top of Ubuntu1204 and ready to commit.
Note: This commit is at local docker registery.
After the commit a new image is created as shown above. Notice is that user is logged in as brindy1 container on Ubuntu:12.04 image.
Now user continues installing some other packages like ssh, curl and facter and commit the new changes to same image as provided in last commit(ubutu1204_wget).
Docker images will create a new image with lastest image_id(8c51bfd4316e) as shown above. i,e as user commit the new images old images are discarded and the new ones
will become latest images.
11 Remove Images
12 Using latest repository(After few commits).
13 Dockerfile
Visit here for Dockerfile syntax/usage