docker run --name <your_container_name> alpine/git <git_command>
docker run -it --name <your_container_name> alpine/git <git_command>
: Run with tty interactivedocker run -d --name couch -p 8091-8094:8091-8094 -p 11210:11210 couchbase
: Run (e.g. a server) unattacheddocker cp container_name:/git/getting-started .
: Copy files/folders between a container and the local filesystemdocker start <your_container_name>
: Start a stopped containerdocker attach <your_container_name>
: Attach to running containerdocker exec -it couch cbq --user Administrator
(docker exec -it <container name> <command>
): Execute commandsdocker exec -it <container name> /bin/bash
: Attach to running container, run a bash shell; With VS Code, you can also directly attach to running container.docker stop <container_name_old>
thendocker commit <container_name_old> <container_name_new>
thendocker run --name <container_name_new> -p 7777:7777/udp -td <new_image_name>
to "restart a container with port mapping" - you can only specify port mapping withdocker run
.
-
-
Save SGTGunner/480b919fd1baeb53967da899382d80a2 to your computer and use it in GitHub Desktop.
Docker Usages Notes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment