◂ Previous |
---|
- docker installed
- macOS Mojave - Version 10.14.5
- Docker Desktop - Version 2.0.0.3 (31259)
To build the docker image run the following command on the terminal:
docker build -t nginx-static-html-image:v1 .
To list the created docker images run the command on the terminal:
docker images
Run the following command to spin up the container server:
docker run -d -p 45678:80 nginx-static-html-image:v1
To list all the containers running run this command on the terminal:
docker ps -a
Run the following command to ensure the server is running:
curl localhost:45678
You can also view it in the browser by going to localhost:45678
and the HTML page similar the the one below will show up:
To stop the container that is running use this command:
docker stop {container_id}
To delete the container that was created use this command:
docker rm {container_id}
To delete the docker image that was created:
docker rmi {image_id}
Next ▸ |
---|