If you have a Dockerfile
in your project, then go to that folder e.g. /path/to/my/project
then type docker build -t CONTAINER_NAME .
where CONTAINER_NAME
is a name of your choice.
docker start -p
docker pull host:port/something
docker run CONTAINER_NAME -P
To list all the docker images in your repository: docker images
.
To remove images that should not be needed anymore.
The identifier 'none' appears as '' in the list of the command docker images
.
- Linux
$ docker images --no-trunc | grep none | awk '{print $3}' | xargs -r docker rmi
- MacOS
$ docker images --no-trunc | grep none | awk '{print $3}' | xargs docker rmi
Alternative: $ docker images|awk '{print $1_":"_$2}'|xargs docker rmi
Alternative: $ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /etc:/etc spotify/docker-gc
To remove containers with the Exit
status.
- Linux
$ docker ps -a --no-trunc | grep 'Exit' | awk '{print $1}' | xargs -r docker rm
- MacOS
$ docker ps -a --no-trunc | grep 'Exit' | awk '{print $1}' | xargs docker rm
Recently a new list of commands has been provided:
docker system prune
docker container prune
docker exec -it e049bd80c225 bash
The trick to fix the mess with certificates: boot2docker ssh 'sudo /etc/init.d/docker restart'
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <CONTAINER_ID>
docker ps -q > running_containers_ids.txt
docker-machine restart <VM_NAME>
while read DOCKER_CONTAINER_ID; do docker start "$DOCKER_CONTAINER_ID"; done < running_containers_ids.txt
rm running_containers_ids.txt
Alternative:
docker ps --no-trunc | grep -v 'CONTAINER' | awk '{print $1}' | xargs echo docker start
VBoxManage showhdinfo ~/.docker/machine/machines/<VM_NAME>/disk.vmdk
cat ~/.docker/machine/machines/<VM_NAME>/config.json | jq '.Driver.Memory'
VBoxManage showvminfo <VM_NAME>
VBoxManage modifyvm <VM_NAME> --memory 8000
Removing VirtualBox virtual adapters:
From the GUI: Preferences -> Network -> Host-only Network, remove vboxnet#
Command: VBoxManage hostonlyif remove vboxnet4