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
.
Last active
February 10, 2023 21:44
-
-
Save chaojian-zhang/673afc17790a7ed51971a5860d6b8143 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