Building and running the Docker image
Build the Docker image and run it using the shell program with the bash Sample/build.sh
command from the root directory.
The script triggers the underlying Docker commands, such as:
-
Check and clean the existing running containers.
-
Build the Docker image.
-
Run the container with the necessary runtime parameters.
Due to the sequence of the commands stacked in the shell script, it shows the list of containers and the logs of the Docker container. |
Mounting the certificates in a volume
If you need to mount the certificates in a volume, the build.sh
script requires the following changes in the docker run
command.
docker run -d -v /certs:/etc/ssl/ -p 80:80 -p 443:443 -name <container-name> -tid <container-image:tag> --env params_file_path="Sectigo-ssl-config.txt"
In the preceding command, -v /certs:/etc/ssl
is an enablement of volume support to place certificates out of the container, where certs
is a host machine directory that maps to /etc/ssl
in the container directory.
It is assumed that ports 80
and 443
are not assigned to any service and are available for assignment in Docker.
If these ports are already assigned, make the necessary changes to the command.
Investigating the Docker image
To investigate the Docker image, use the following commands.
docker logs <container-name>
docker exec -it <container-name> /bin/bash
While the docker logs
command helps with debugging information on the entrypoint
script, the docker exec
enables running the command in the Docker container itself.
With docker exec
, commands can be executed to check the contents of various files and the status of services in the Docker container.
For a complete list of Docker commands, see Docker CLI.