docker build -t docker-cdh54 .
docker run -v /root/docker:/root -p 8042:8042 -p 8088:8088 -p 8020:8020 -p 8888:8888 -p 11000:11000 -p 11443:11443 -p 9090:9090 -d -ti --privileged=true docker-cdh54
docker attach 922ac2f47d93docker images
docker ps
Output example:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9265bc46c9ce rabbitmq:3-management "docker-entrypoint..." 2 hours ago Up 2 hours 4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, 15671/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp laughing_lamarr
3c579f0d72f8 mysql:5.7 "docker-entrypoint..." 2 hours ago Up 2 hours 0.0.0.0:3306->3306/tcp, 33060/tcp thirsty_fermi
docker ps | tail -n +2 | while read cid b; do echo -n "$cid\t"; docker inspect $cid | grep IPAddress | cut -d \" -f 4; done
docker inspect --format '{{ .NetworkSettings.Networks.dockerdevstack_default.IPAddress }}' <name of container>
docker stop <container id>
for example
docker stop 9265bc46c9ce
docker attach 9265bc46c9ce
From docker 1.3 onwards.
docker exec -it <containerIdOrName> bash
You can disconnect and leave the container running by typing Ctrl+p followed by Ctrl+q.
https://www.cloudera.com/documentation/enterprise/5-6-x/topics/quickstart_docker_container.html
docker run -v /home/mathieu/datashare/dev:/home/mathieu/datashare/dev -p 8042:8042 -p 8088:8088 -p 8020:8020 -p 8888:8888 -p 11000:11000 --hostname=quickstart.cloudera --privileged=true -t -i cloudera/quickstart /usr/bin/docker-quickstartor my own baseline
docker run -v /home/mathieu/datashare/dev:/home/mathieu/datashare/dev -p 8042:8042 -p 8088:8088 -p 8020:8020 -p 8888:8888 -p 11000:11000 --hostname=quickstart.cloudera --privileged=true -t -i cloudera/base2017-10-20 /usr/bin/docker-quickstartdocker run -it YOUR_IMAGE /bin/sh
docker run -it --entrypoint /bin/sh YOUR_IMAGE
docker run -it gcc:8.2 sh
run mount local volume
docker run -it -v $(pwd):/app gcc:8.2 sh
docker run -t -i -v <host_dir>:<container_dir> ubuntu /bin/bash
docker run -it -v $(pwd):/app retrace-base-image:0.2 bash
docker run --name some-memcached -p 11211:11211 -d memcached
docker cp $CONTAINER_ID:/root/.utctestchain /tmp/.utctestchain
docker logs -f objective_shtern
docker-compose up -d
docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d
docker-compose down
docker-compose stop <name of my service>
docker-compose logs -f <name of service>
docker-compose up -d && docker-compose logs -f
docker-compose exec <name of service> bash
Authenticate docker with gcr by downloading for your platform docker-credential-gcr and add it to your path: https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases
Run the docker-credential-gcr tool to configure and authenticate docker with gcloud.
docker-credential-gcr configure-docker
docker-credential-gcr gcr-login
docker-credential-gcr gcr-logout
--> ~/.config/gcloud/docker_credentials.json is deleted
ref: https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes#:~:text=Remove%20all%20images,docker%20images%20%2Da ref: https://docs.docker.com/config/pruning/#:~:text=Prune%20containers&text=A%20stopped%20container's%20writable%20layers,the%20docker%20container%20prune%20command.&text=y%2FN%5D%20y-,By%20default%2C%20you%20are%20prompted%20to%20continue.,f%20or%20%2D%2Dforce%20flag.
Docker provides a single command that will clean up any resources — images, containers, volumes, and networks — that are dangling (not associated with a container):
docker system prune
To additionally remove any stopped containers and all unused images (not just dangling images), add the -a flag to the command:
docker system prune -a