docker-cloud repository query doesn't provide a response - docker

I'm trying to query docker-cloud repository using this command
docker-cloud repository ls
I get this response.
NAME IN_USE
My repos are located here and have active images
https://hub.docker.com/r/fellfromhell/workshop-python/
What am I doing wrong?

There are 2 different systems: Docker Hub and Docker Cloud.
Docker Hub is a cloud-based registry. Docker Cloud is a service which helps to deploy and manage Dockerized applications. You can link Docker Cloud to repositories hosted on a third party registry. The Docker Hub registry is linked automatically and all your Docker Hub repositories are listed in https://cloud.docker.com/_/repository/list, but, unfortunately, the command
docker-cloud repository ls
returns only repositories that are on a third party registries (see
https://docs.docker.com/apidocs/docker-cloud/#external-repository).
Despite this, you still can inspect your image
docker-cloud repository inspect fellfromhell/workshop-python
and get some data in response. Here is the github issue https://github.com/docker/dockercloud-cli/issues/23

Related

Using Artifactory instead of ECR

We've just brought Artifactory into our organization. We have a lot of Fargate stacks that are pulling the Docker images from ECR. We now want to pivot and store our Docker images in Artifactory and tell Fargate to pull the images from Artifactory.
Does anyone know how to do this?
Thanks
An Artifactory repository for Docker images is a Docker registry in every way, and one that you can access transparently with the Docker client (see documentation)
In Artifactory, start by creating a local Docker repository, then follow the "Set Me Up" instructions for that repository to upload/deploy your docker images to it.
The "Set Me Up" dialog for the Docker repository also provides the steps to have your docker clients consume/download the images from your Docker repository/registry. You would just have to replace the references of ECR with the one for your Artifactory docker repository/registry in your docker client commands.
This documentation page provides step-by-step information on how to use Artifactory as a Docker registry.
Artifactory also provides the capabilities of Remote Docker repositories, which provides proxying/caching of external registries, and Virtual Docker repositories for the aggregation of both local and remote repositories into one single entry point.

What is "PARALLEL BUILD" in docker hub private registry?

While trying to signup with docker hub by selecting a suitable plan, I see pricing is based on Private Repositories Required and Parallel Builds desired.
What is a PARALLEL BUILD in this context?
PS:
After a bit of an internet search, I found that docker hub can pull up my source code from external repositories and build an image by itself and later publish the same into Hub. If this is true and I don't want to use docker hub build service, can I ignore the PARALLEL BUILD part entirely?
Dockerhub is a service provided by Docker for finding and sharing container images with your team. It provides the following major features:
Repositories: Push and pull container images.
Teams & Organizations: Manage access to private repositories of
container images.
Official Images: Pull and use high-quality container images provided
by Docker.
Publisher Images: Pull and use high-quality container images provided
by external vendors. Certified images also include support and
guarantee compatibility with Docker Enterprise.
Builds: Automatically build container images from GitHub and
Bitbucket and push them to Docker Hub
Webhooks: Trigger actions after a successful push to a repository to
integrate Docker Hub with other services.
More info here.
If you see the pricing page of dockerhub. There are two things you should know:
PARALLEL BUILD specifies the number of images that you can build
parallelly (con-currently). The parallelism is across all of the
repos owned by you.
Private Repository specify the number of repository that are private and not exposed publicly.
If you're new to docker and trying out it first time then its ok to go with dockerhub free plan where you can have max 1 private repository and 1 parallel build count.
If you want to store docker images of your project privately that is hosted somewhere on public cloud like AWS then I suggest to use docker registry provided by those cloud providers like AWS ECR, Azure ACR, Google container registry and so on.
Or else you can host docker image privately by running docker registry inside container. Check this.
Hope this helps.

URL of docker hub image for usage in azure service fabric

I have created docker hub repo and also created and pushed a docker image of python application to the repo.
However, I cannot find the correct Url of the image that I have to provide to the other services which will use this image. for eg azure service fabric or Kubernetes.
How can I find the exact URL? Through PowerShell or through the browser...
You don't usually download images by url. Instead, you use the docker CLI with the repository and image name.
If it's a private repo, login first, by using docker login
more about login
Use docker pull {reponame/imagename:tag} to download an image to your machine.
more about pull
Replace {reponame} with the repository name.
Replace {imagename} with the name you used with docker push.
Replace {tag} with the tag you put on the image (or latest).
For example, I use this line to get my docker hub image:
docker pull loekd/nanoserver:2.0

docker difference between private registry and the local image registry?

I have something on my mind that is bugging me. When running docker images I see a list of my local images I have in my docker environment. When pulling Images I pull it from a registry and more specific pull the specified tag managed by the repository.
so there is the registry as the big hub to store all image
repositories
and the repository is storing commits/tagged versions of a specific image
But what is docker images then? It's a registry as well isn't it? It holds all images that I've built locally or pulled.
If my claim is valid:
How does it comply with running a private registry (mentioned here https://docs.docker.com/registry/deploying/)
Running this docker run -d -p 5000:5000 --restart=always --name registry registry:2
Would deploy this new registry into my docker images...
So now I have a registry within my registry... registception?
What is the difference besides the custom registry is deployable?
Its not a local image registry as other questions have pointed. It is an image cache. The purpose of the image cache is to avoid having every time to download the same image whenever you do a docker run.
docker images simply lists all the cached images on the machine. Whenever there is newer image on the registry, the image(some layers) are downloaded and cached when doing docker pull .... Also, when a layer exists in the local cache, docker tells you that, example:
Step 2/2 : CMD /bin/bash
---> Using cache
On the other hand, a docker registry is a central repository to store images. It provide a remote api to pull and push images. The local image cache does not have this feature. Images in the local cache are read and stored used local docker commands that simply read files under /var/lib/docker/...
To make things clear, think of Docker remote registries (such as Docker Hub) as the remote Git repositories. You pull Docker images (like git repositories) that you need and you play with it.
Like remote Git repositories such as GitHub\BitBucket, Docker registries are also public and private. Public registries are for public usage and open-source projects. Examples include in like Docker Hub. Where as private registries are for organizational use or for your own. Examples for private registries include Azure Container Registry, EC2 Container Registry etc.
The official Docker Registry image is just a Docker registry image for your own system, you can't share them with others unless you have a server or a public Internet IP address. Think of it as Bonobo Private Git Server for Windows.
Your local image registry as you mentioned are all those images that you have build locally or pulled from a registry public or private you can see it like a local cache of images that you can re use without download or rebuild each time.
Running the registry what actually does is to spin up a server that implements the Docker Registry API which allows users to push, pull, delete and handles the storage of this images and their layers. See it like a central repository like npm, nexus
For example if you run the registry in your.registry.com:5000
You can do things like
docker build -t your.registry.com:5000/my-image:tag .
docker push your.registry.com:5000/my-image:tag
So others that have access to your server can pull it
docker pull your.registry.com:5000/my-image:tag

Difference between Docker registry and repository

I'm confused as to the difference between docker registries and repositories. It seems like the Docker documentation uses the two words interchangeably. Also, repositories are sometimes referred to as images, such as this from their docs:
In order to push a repository to its registry, you need to have named
an image or committed your container to a named image as we saw here.
Now you can push this repository to the registry designated by its
name or tag.
How can you push a repository to a registry? Aren't you pushing the image to the repository?
Docker registry is a service that is storing your docker images.
Docker registry could be hosted by a third party, as public or private registry, like one of the following registries:
Docker Hub,
Quay,
Google Container Registry,
AWS Container Registry
or you can host the docker registry by yourself
(see https://docs.docker.com/ee/dtr/ for more details).
Docker repository is a collection of different docker images with same name, that have different tags. Tag is alphanumeric identifier of the image within a repository.
For example see https://hub.docker.com/r/library/python/tags/. There are many different tags for the official python image, these tags are all members of the official python repository on the Docker Hub. Docker Hub is a Docker Registry hosted by Docker.
To find out more read:
https://docs.docker.com/registry/
https://github.com/docker/distribution
From the book Using Docker, Developing and deploying Software with Containers
Registries, Repositories, Images, and Tags
There is a hierarchical system for storing images.
The following terminology is used:
Registry
A service responsible for hosting and distributing images. The default registry is the Docker Hub.
Repository
A collection of related images (usually providing different versions of the same application or service).
Tag
An alphanumeric identifier attached to images within a repository (e.g., 14.04 or stable ).
So the command docker pull amouat/revealjs:latest will download the image tagged latest within the amouat/revealjs repository from the Docker Hub registry.
Complementing the information:
You usually push a repository to a registry (and all images that are part of it). But you can push a single image to a registry. In all cases, you use docker push.
An image has a 12-hex-digit Image ID, but is also identified by: namespace/repo-name:tag
The image full name can be optionally prefixed by the registry host name and port: myregistryhost:5000/namespace/repo-name:tag
A common naming convention is to use your registry user-name as what I called "namespace".
A docker repository is a cute combination of registry and image.
docker tag foo <registry>/<image>:<tag>
is the same as
docker tag foo <repository>:<tag>
Docker Registry is a service, which you can either host yourself (Trusted and Private) or you can let docker hub be the host for this service. Usually, if your software is commercial, you will have hosted this as a "Private and Trusted" registry. For Java Developers, this is somewhat analogous to Maven Artifactory setup.
Docker Repository is a set of "Tagged" images. An example is that you might have tagged 5 of ubuntu:latest images:
a) Nano editor (image1_tag:v1)
b) A specific software 1 (image1_tag:v2)
c) Sudo (image1_tag:v3)
d) apache http daemon (image1_tag:v4)
e) tomcat (image1_tag:v5)
You can use docker push command to push each of the above images to your repository. As long as the repository names match, they will be pushed successfully, and appear under your chosen repository and correctly tagged.
Now, your question is, "So where is this repository hosted/who is managing the service"? That is where Docker Registry comes into picture. By default you will get a docker hub registry (Open Source) which you can use to keep your private/public repository. So without any modification, your images will be pushed to your private repository in docker hub. An example output when you pushing your image tags are the following:
docker#my-docker-vm:/$ docker push mydockerhub/my-helloworld-repo:my_tag
The push refers to repository [docker.io/mydockerhub/my-helloworld-repo]
bf41e934d39d: Pushed
70d93396f87f: Pushed
6ec525dfd060: Pushed
705419d10b13: Pushed
a4aaef726d02: Pushed
04964fddc946: Pushed
latest: digest: sha256:eb93c92351bce785aa3ec0de489cfeeaafd55b7d90adf95ecea02629b376e577 size: 1571
docker#my-docker-vm:/$
And if you type immediately docker images --digests -a you can confirm that your pushed image tags are now showing new signature against the private repository managed by docker hub registry.
A Docker image registry is the place to store all your Docker images. The image registry allows you to push and pull the container images as needed.
Registries can be private or public. When the registry is public, the images are shared with the whole world whereas in the private registry the images are shared only amongst the members of an enterprise or a team.
A registry makes it possible for the Docker daemon to easily pull and run your Docker images.
Docker Hub and other third party repository hosting services are called “registries”. A registry stores a collection of repositories.
As a registry can have many repositories and a repository can have many different versions of the same image which are individually versioned with tags.
The confusion starts with this definition of a tag: "An alphanumeric identifier attached to images in a repository"
I'd rather call that alphanumeric identifier that you append with a ':' a tag-suffix for now. When somebody says "'latest' is the default tag", then this kind of tag-suffix is meant.
In reality, the :latest' suffix is technically part of the tag. The entire name is a tag. All these are tags (possibly referring to the same image):
myimagename
myimagename:latest
username/theirimagename:1.0
myrepo:5000/username/imagename:1.0
(I say imagename here, just to illustrate the other main source of confusion. That's the repositoryname, of course. Sorry.)
Examples:
a) When you want to name your image while building, you use docker build -t thisname ... -- that is -t for tag, (not -n for name).
b) When you want to push that image to a registry, you need to have the full URL (starting with registryname and ending with a tag-suffix) as a tag:
docker tag thisname mylocalregistry:5000/username/repoimagething:1.0
Now you push the image known as thisname by saying:
docker push mylocalregistry:5000/username/repoimagething:1.0
Naming things is hard.
Alas! A repository is not a "container" (aaargh...) where you put things in, that is what muggles think...

Resources