Permission message while copying container images from one Bluemix registry to another - docker

I am trying to copy one of Bluemix registry , registry.ng.bluemix.net/XXXX/rhel:v5 to another i.e. registry.ng.bluemix.net/YYYY/rhel:v5
by using command , after logging into Bluemix account & space associated with XXXX
cf ic cpi registry.ng.bluemix.net/XXXX/rhel:v5 registry.ng.bluemix.net/YYYY/rhel:v5
Note, I have access to both the org, spaces.
Bluemix showing following message ...
Sending build context to Docker daemon 2.048kB
Error response from daemon: Build aborted with error: User does not have access to namespace 'YYYY' Build ID: 268-1502886177.269-12875
FAILED
Command failed
Please suggest, what could go wrong and is there a way to proceed forward ?

The build service currently only supports building from and to the oldest namespace owned by the targeted organization. This includes copying images using cf ic cpi.
To achieve what you want, you'll need to pull the image to your workstation, tag it, then push it back to the registry with the new name:
bx login <account with access to both namespaces>
bx cr login
docker pull registry.ng.bluemix.net/XXXX/rhel:v5
docker tag registry.ng.bluemix.net/XXXX/rhel:v5 registry.ng.bluemix.net/YYYY/rhel:v5
docker push registry.ng.bluemix.net/YYYY/rhel:v5
# Optional: remove the images from your machine: docker rmi registry.ng.bluemix.net/XXXX/rhel:v5 registry.ng.bluemix.net/YYYY/rhel:v5

Related

Docker Manifest creation fails: unsupported registry version

I just built two images and pushed them to my registry (docker registry v2), one of them tagged with hub.domain.com/image:tag-amd64 and the other hub.domain.com/image:tag-arm64. Now i want to create hub.domain.com/image:tag as a manifest list of both so I can pull the image platform independent.
First I tried to just create the manifest like this:
$ docker manifest create hub.domain.com/image:tag hub.domain.com/image:tag-amd64 hub.domain.com/image:tag-arm64
failed to configure transport: unsupported registry version
Then I pulled both images to my local machine and then repeated the manifest creation with the same result.
Finally I tried tagging the iamges with local tags image:tag-a(rm|md)64 respectively and retried the creation:
$ docker tag hub.domain.com/image:tag-arm64 image:tag-arm64
$ docker tag hub.domain.com/image:tag-amd64 image:tag-amd64
$ docker manifest create hub.domain.com/image:tag image:tag-amd64 image:tag-arm64
errors:
denied: requested access to the resource is denied
unauthorized: authentication required
$ # I also logged in with:
$ docker login -u user hub.domain.com
Password: ....
Login Succeeded
What am I doing wrong?
I know that i can create multi-platform images with docker buildx, but in this case my dockerfile differs for each platform and I don't know how to merge these into one manifest.

Docker push to private registry error [denied: requested access to the resource is denied]

I login like this:
PS C:\workl> docker login some-registry.io -u username#corp.company.com -p somePasswrod
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded
When I run docker images I get this
CREATED = user/custom-images
tag 1
imageID=34e982156f
I then try to push
docker push user/custom-image:1
The push refers to repository [docker.io/library/custom-image]
50c2af6d2450: Preparing
862d28b9e0d9: Preparing
...
...
878dab86cf0f: Waiting
denied: requested access to the resource is denied
Why? I am adding a tag and have seen others online similar to this but don't seem to be able to find a solution. I can pull just fine.
you need to follow this steps to push to a container :
1/ create a repository inside docker hub https://hub.docker.com/repositories :
just click on create a new repository.
2/ tagging your local image:
docker tag /
the repo_name is the one you created in step 1
3/ commit the image :
docker commit <existing-container> <hub-user>/<repo-name>
4/ and finnaly push it :
docker push <hub-user>/<repo-name>
As #altvits said,
If you want to push to some-registry.io you need to tag it like
docker image tag image:tag some-registry.io/path/image:tag and push it as docker image push some-registry.io/path/image:tag.
Without tagging the push will attempt to push to the default location which in your case is docker.io

Docker Push has failed in Red Hat Server with error "**denied: requested access to the resource is denied**"

I am new bee to docker concepts . I have been trying the samples of creating images and push in docker hub on red hat server.
I used below command to push my image to hub (Note : i dont have any special char to my image name)
docker push registry.hub.docker.com/ssqaapt/first-img-sample
I am facing an below error when I push the image to docker hub repo .
[root#p01 simple-web-app]# docker push registry.hub.docker.com/ssaapt/wipro-first-img-sample
The push refers to a repository [registry.hub.docker.com/ssaapt/first-img-sample]
673be84d418c: Preparing
....
b6a02001ba33: Waiting
....
denied: requested access to the resource is denied
I tried the push after i have logged my docker acc using ths cmd docker login .
Please suggest me if i have done anything wrong or do i need any configuration change .
I verified this link(denied: requested access to the resource is denied : docker) as well but no luck .
Go to /etc/containers/registries.conf
Add/Replace ‘registry.hub.docker.com’ for [registries.search] and [registries.insecure]section.
Restart your docker
$ systemctl stop docker
$ systemctl start docker
$ docker login-
Execute the push command and it should work.

Access denied when pulling Docker image from a repository I own

I built a Docker image that I pushed to Docker Hub under my account and removed locally after. But when I try to pull it, it throws the following error:
Error response from daemon: pull access denied for mightyspaj/dockerfile-assignment-1, repository does not exist or may require 'docker login'
I'm logged into the same account that owns the repository for this image and can perform other tasks (such as pushing) perfectly fine. The repository also definitely exists on Docker Hub, yet it fails when I try to pull it.
I've tried the following things:
Logging out of my account and back in again
Renaming config.json and regenerating it
Running an isolated Docker container with docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock:ro docker sh, then logging into my account and attempting to pull the image
Deleting and recreating the repository
All of these things still produce the same error. I'm baffled.
To note, both my client and engine versions are 17.12.0-ce. My OS is Ubuntu 17.10 (64-bit).
Console output
docker login
-> % docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: mightyspaj
Password:
Login Succeeded
docker tag
-> % docker tag dockerfile-assignment-1:latest mightyspaj/dockerfile-assignment-1
docker push
-> % docker push mightyspaj/dockerfile-assignment-1
The push refers to repository [docker.io/mightyspaj/dockerfile-assignment-1]
8427a8e6a29f: Pushed
655a921743e8: Pushed
8aa44edb7524: Pushed
60f1a2dc4cd8: Mounted from library/node
9185fe936b87: Mounted from library/node
e53f74215d12: Mounted from library/node
latest: digest: sha256:6c68220ba84f13d0229ef4458f22369410bb98764b908a75be0849c3003de160 size: 1582
docker image rm
-> % docker image rm mightyspaj/dockerfile-assignment-1
Untagged: mightyspaj/dockerfile-assignment-1:latest
Untagged: mightyspaj/dockerfile-assignment-1#sha256:6c68220ba84f13d0229ef4458f22369410bb98764b908a75be0849c3003de160
docker image pull
-> % docker image pull mightyspaj/dockerfile-assignment-1
Using default tag: latest
Error response from daemon: pull access denied for mightyspaj/dockerfile-assignment-1, repository does not exist or may require 'docker login'
I could fix the same issue only when I made the repository public. Make sure the repository is public then this is the set of instructions I followed in command line:
Once logout from docker hub and login again.
1- docker logout
2- docker login --username=YOURUSERNAME
Enter password when asked
3- docker pull repositoryName"/"imageName[:tag]
if "tag" is not included the default value will be "latest".
Then check the images by docker images command to check if its been pulled.
After pulling is done I made the repository private again.
This solution is only valid on private docker repositories!!
First try to login on your private repo e.g:
docker login dockerrepo.example.com
Then
If you build new image with dockerfile based on image in your private repository then you must prefix your base image with private repository url:
FROM PRIVATE_REPO_URL + IMAGE_INFO
sample:
PRIVATE_REPO_URL --> dockerrepo.example.com
BASE_IMAGE --> samples/java/jdk:1.6
Your dockerfile look like this:
FROM dockerrepo.example.com/samples/java/jdk:1.6

Unable to push my docker to Bluemix - Login error

I created my dockers using a makefile, and checked if it was correct. In fact, I was able to run it and even upload to Docker Hub without problems. I then followed the steps suggested to upload the docker to Bluemix, and was unable to do it. I am getting an error telling me that my credentials are incorrect, although I am sure they are not (in fact, I was able to login on the Bluemix website using the same credential without problems).
See below the steps I did and the error obtained, any suggestion to solve them will be welcomed:
$ cf login
API endpoint: https://api.eu-gb.bluemix.net
Email> agorostidi
Password>
Autenticando...
OK
Org seleccionada agorostidi
Space seleccionado dev
Endpoint API: https://api.eu-gb.bluemix.net (version de API: 2.40.0)
Usuario: andres.gorostidi#gmail.com
Org: agorostidi
Space: dev
MacBook-Pro-de-Andres:apache-docker andres$ cf ic login
Client certificates are being retrieved from IBM Containers...
Client certificates are being stored in /Users/andres/.ice/certs/...
Client certificates are being stored in /Users/andres/.ice/certs/containers-api.eu-gb.bluemix.net/504cc61c-47e2-4528-914a-3def71277eea...
OK
Client certificates were retrieved.
Deleting old configuration file...
Checking local Docker configuration...
OK
Authenticating with registry at host name registry.eu-gb.bluemix.net
OK
Your container was authenticated with the IBM Containers registry.
Your private Bluemix repository is URL: registry.eu-gb.bluemix.net/goros
You can choose from two ways to use the Docker CLI with IBM Containers:
Option 1: This option allows you to use "cf ic" for managing containers on IBM Containers while still using the Docker CLI directly to manage your local Docker host.
Use this Cloud Foundry IBM Containers plug-in without affecting the local Docker environment:
Example Usage:
cf ic ps
cf ic images
Option 2: Use the Docker CLI directly. In this shell, override the local Docker environment to connect to IBM Containers by setting these variables. Copy and paste the following commands:
Note: Only Docker commands followed by (Docker) are supported with this option.
export DOCKER_HOST=tcp://containers-api.eu-gb.bluemix.net:8443
export DOCKER_CERT_PATH=/Users/andres/.ice/certs/containers-api.eu-gb.bluemix.net/504cc61c-47e2-4528-914a-3def71277eea
export DOCKER_TLS_VERIFY=1
Example Usage:
docker ps
docker images
MacBook-Pro-de-Andres:apache-docker andres$ docker push registry.ng.bluemix.net/eci_test/chargeback:latest
The push refers to a repository [registry.ng.bluemix.net/eci_test/chargeback] (len: 1)
Sending image list
Please login prior to push:
Username: agorostidi
Password:
Email: andres.gorostidi#gmail.com
Error response from daemon: Wrong login/password, please try again
You logged in to the Bluemix London region and are trying to push an image to the Bluemix US South region, that's why docker push command is asking for your credentials again.
If you want to push your images to the Bluemix US South region you have to login to that region first.
Please point your API to the Bluemix US South region with the following command:
$ cf api https://api.ng.bluemix.net
Then proceed again with the commands you run before, i.e.:
$ cf login
$ cf ic login
$ docker push registry.ng.bluemix.net/eci_test/chargeback:latest
Otherwise, if you want to push your image to the Bluemix London region, then you have to re-tag the image name to match the London region:
$ docker tag chargeback:latest registry.eu-gb.bluemix.net/eci_test/chargeback:latest
Then you can run the docker push command specifying the new tagged image.

Resources