- To run Docker as a non-root user, you have to add your user in the docker group.
- Create a docker group if there isn't one:
$ sudo groupadd docker
- Add your user to the docker group:
######Mention UserName is place of $USER###### $ sudo usermod -aG docker $USER
- Log out and log back in so that your group membership is re-evaluated. If you are on the EC2 machine, then carry out a reboot (stop and start is not required).
Now, we will have to be aware of the following activities with Docker containers before going ahead with the microservice deployment:
- Run containers, persistence storage
- Expose port
- Create an image using Dockerfile and push it to Docker Hub