Docker command summary
If you are new to Docker, this section provides an introduction to common commands and options that are useful to know when administering a Conjur container installation. See the full list of commands in the Docker CLI documentation.
|
Podman is CLI-compatible with the Docker CLI. You can configure Alternatively, you can manually replace All references to Docker in this document apply to Podman as well. |
Commands
Command | Description |
---|---|
docker run
|
Start a container from an image. |
docker exec
|
Run a command inside a container. |
docker restart
|
Restart a running container. |
docker stop
|
Stop a container. |
docker rm
|
Remove a container. |
docker ps
|
List running containers. |
docker cp
|
Copy files to/from a container. |
docker logs <container_name>
|
View the logs (stdout) of a container. To follow logs, add the
|
Below are some useful commands for interacting with the Conjur container within a host VM:
Action |
Command |
---|---|
Get a shell in the container |
|
Run a one-off command in a container. If the command requires input from the host, be sure to use the -i/--interactive (keeps STDIN open) and/or -t/--tty (allocates a pseudo TTY) options as needed. |
|
Copy a file from the host to the container. Usually it's recommeded to volume-mount a host directory into the container. |
|
Copy a file from container to the host. |
|
Options
Many options can be passed to docker run
that affect how a container behaves.
The following are commonly-used options for running a Conjur container. All options are covered in full in the docker run reference.
Command | Description |
---|---|
--name
|
Set a name for the container. |
-d / --detach
|
Run the container in the background. |
--restart
|
Set the container's restart policy. |
--security-opt
|
Run the container with a security profile. |
-p / --port
|
Forward a port from the container to the host. |
-v / --volume
|
Mount a directory/file from the host into the container. |
-e / --env
|
Set a list of environment variables within the container when it is run. |