In this post which is the continuation of Node-API Docker Image ( the Links are at the end of the post), create and run container using the image we build.
Lets check the existence of the image in docker using
docker image
Create the container
To build a container to run the API we need only the Image , all the depending Image will be automatically download by Docker.
docker run --name customer -d -p 3000:3000 user-api:latest
The above command will run, customer API in detached mode on port 3000.
Stop and Resume the container
We can stop running a container at any time using docker stop <id/name> and resume with docker start <id/name>
Following Docker Post may deserve a good read
- How to Containerize Golang app with Docker
- How to create a strapi project with Docker on Windows
- Docker-compose for projects
- Create a docker image of Node-Express API – Part II
- Create a docker image of Node-Express API – Part I
- Create portfolio app with nginx in 5 minute
- Start a nginx app container in Docker
- Howto download images in Docker