Go to https://hub.docker.com and create an account, if you haven’t yet
Prepare Dockerfile that will be source of your Docker image. Here is a simple one:
Run terminal and go to directory where Dockerfile is located (prepared in previous step)
Build image using docker build command and Dockerfile prepared in 2nd step:
Use the docker login command to login to your account created in 1st step:
Upload created image to Docker Hub using docker push command
If you open your Docker’s profile, you will see your new image. Image used as an example: https://hub.docker.com/r/kniziol/php.
Finally, use created and pushed image to create container and service: