Basic docker commands page has been introduced to help docker newcomers to start working with docker with few basic commands.
Docker client installed on your testbed/workstation
There is many ways how to install docker client. We recommend this on CentOS/Fedora:
Or Ubuntu:
|
For using docker without "sudo" user must be member of "docker" group on testbed to be able to utilize docker properly without need to type sudo all the time:
sudo groupadd docker sudo usermod -a -G docker $USER # in edge case this can help: #setfacl -m user:$USER:rw /var/run/docker.sock |
This is because docker daemon unix socket is owned by root user. However, docker daemon can be controlled members of docker group, so we are utilising this feature.
docker login <REPOSITORY_URL> # Or with providing username to avoid asking username repeatedly docker login -u <USER_NAME> <REPOSITORY_URL> # Or with providing username and password to avoid asking credentials - do not use in shared environments as other users could be able to find your password in plaintext in command history docker login -u <USER_NAME> -p <USER_PASSWORD> <REPOSITORY_URL> |
docker pull <IMAGE>:<TAG> |
docker pull <REPOSITORY_KEY>.artifactory.shared.tds.CUSTOMERX.com/<IMAGE>:<TAG> |
docker tag <IMAGE>:<TAG> <REPOSITORY_KEY>.artifactory.shared.tds.CUSTOMERX.com/<IMAGE>:<TAG> |
docker push <REPOSITORY_KEY>.artifactory.shared.tds.CUSTOMERX.com/<IMAGE>:<TAG> |
docker images |
docker rm <IMAGE_ID> |
docker container ls --all |
docker run <REPOSITORY_KEY>.artifactory.shared.tds.CUSTOMERX.com/<IMAGE>:<TAG> |
This command removes all unused images, containers and other data from docker locally. For more info, refer to official documentation. It is helpful for easy starting with the "clear table". |
docker system prune -a -f |