This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
docker:start [2023/12/09 01:15] dwheele created |
docker:start [2023/12/26 18:59] (current) dwheele [Cheat Sheet] |
||
|---|---|---|---|
| Line 9: | Line 9: | ||
| ^docker create|Create a local image| | ^docker create|Create a local image| | ||
| ^docker create --name=foo -it ubuntu bash|-i = interactive\\ -t = pseudo TTY\\ running bash when starting| | ^docker create --name=foo -it ubuntu bash|-i = interactive\\ -t = pseudo TTY\\ running bash when starting| | ||
| + | ^docker start foo | Start container running| | ||
| + | ^docker attach foo|Attach Standard In/Out to container\\ escape with Control-P Control-Q| | ||
| + | ^Control-p Control-q|Escapes from docker attach| | ||
| + | ^docker logs foo|Shows the standard in/out from container that has run in the background| | ||
| + | ^docker image ls|List all images that are present/ | ||
| + | ^docker rm foo|Remove container| | ||
| + | ^docker inspect foo|Inspect container - shows network| | ||
| + | ^docker network ls|Shows networks| | ||
| + | ^docker run < | ||
| + | ^docker search < | ||
| + | ^docker build . -t serve_image |Build a docker image from a Dockerfile in the current directory| | ||
| + | ^docker run -p 3001:3000 --name=serve_container serve_image|Run the image, mapping the internal port 3000 from " | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Troubleshooting ===== | ||
| + | |||
| + | ==== network is unreachable ==== | ||
| + | |||
| + | when trying to run | ||
| + | <code bash> | ||
| + | docker run hello-world | ||
| + | </ | ||
| + | |||
| + | Kept getting: | ||
| + | |||
| + | < | ||
| + | connect: network is unreachable | ||
| + | </ | ||
| + | |||
| + | Solved problem by changing / | ||
| + | < | ||
| + | nameserver 8.8.8.8 | ||
| + | </ | ||
| + | |||
| + | Perhaps the usual 192.168.0.1 nameserver can't properly handle the docker registry server. Which is: | ||
| + | |||
| + | <code text> | ||
| + | https:// | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | [12/ | ||
| + | |||
| + | |||