Skip to content
Advertisement

docker hub do you create a repository for every image

I am new to docker and docker hub. I am trying to understand the repository on docker hub. I have dockerized a django web app using nginx and gunicorn. enter image description here My question is: Since this has multiple images within the container:

  1. would each image be a different repository on docker hub or
  2. would it be in the same repository, but with different tags such as :web or :nginx?

Here is my docker-compose.yml:

JavaScript

and

Dockerfile

JavaScript

Advertisement

Answer

Generally, tags represent different versions of the same base container or application.

Therefore, it’s recommended to have separate repositories for the static assets (nginx) and the backend api (your web image), however this isn’t a hard rule. You could just as easily do app:v1-nginx and app:v1-api, but the API will likely be tagged and pushed more often than the other, so the version numbers wouldn’t necessarily be aligned

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement