Add start of Docker information
This commit is contained in:
parent
91e17c692f
commit
9be486087a
|
@ -14,5 +14,6 @@
|
|||
- [Angular](./angular.md)
|
||||
- [.NET](./dotnet.md)
|
||||
- [Go](./golang.md)
|
||||
- [Docker](./docker.md)
|
||||
- [Windows Terminal](./windows-terminal.md)
|
||||
- [Visual Studio Commands](./visual-studio.md)
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
# Docker
|
||||
> Unless otherwise noted, commands run on Ubuntu 22.
|
||||
|
||||
## Setup
|
||||
```bash
|
||||
# Add the current user to the docker group so docker can be run without sudo.
|
||||
sudo usermod -aG docker ${USER}
|
||||
su - ${USER}
|
||||
```
|
||||
|
||||
## Basics
|
||||
```bash
|
||||
# Get installed version.
|
||||
docker -v
|
||||
|
||||
# Verify Docker is setup / run the Hello World image.
|
||||
sudo docker run hello-world
|
||||
|
||||
# Check whether Docker is running.
|
||||
sudo systemctl status docker
|
||||
|
||||
# Search Docker Hub for all images matching a search term (<term>).
|
||||
docker search <term>
|
||||
|
||||
# Show all downloaded images.
|
||||
docker images
|
||||
```
|
||||
|
||||
## Containers
|
||||
```bash
|
||||
# List running containers.
|
||||
docker ps
|
||||
# List all containers.
|
||||
docker ps -a
|
||||
|
||||
# Start a container with <container-id> or <container-name>.
|
||||
docker start <container-id>
|
||||
docker start <container-name>
|
||||
|
||||
# Stop a container with a <container-id> or <container-name>.
|
||||
docker stop <container-id>
|
||||
docker stop <container-name>
|
||||
|
||||
# Remove a container with a <container-id> or <container-name>.
|
||||
docker rm <container-id>
|
||||
docker rm <container-name>
|
||||
```
|
Loading…
Reference in New Issue