Docker pull access denied for docker-image

3k Views Asked by At

I am trying to build a docker image for my apache-beam Python script that will be deployed on Google DataFlow. The script compiles a template that is placed in a Google Storage bucket. I am working on a windows machine and running everything on Visual Studio Code.

I have written the following in my docker file

FROM python:3.10.9
ADD compile_pipeline_template.py .
ADD first_service_account_key.json .
RUN pip install requests pandas apache-beam apache-beam[gcp]
ENV GOOGLE_APPLICATION_CREDENTIALS="./first_service_account_key.json"
CMD ["python", "./compile_pipeline_template.py"]

The structure of my file is simple

file/
    | -- compile_pipeline_template.py
    | -- first_service_account_key.json
    | -- Dockerfile

I then run docker build -t docker-image . upon which it seems to successfully build the image. The image shows up on the Docker Desktop application but does not show up in the file where I built it. I can run it though using docker run docker-image.

The problem arises when I run docker pull docker-image and it raises Using default tag: latest Error response from daemon: pull access denied for docker-image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

I am not sure what I am doing wrong. Please help me to identify the issue.

1

There are 1 best solutions below

0
Alez On

You should try to log out docker logout [options] and then login docker login [options] from the command line to your docker hub account before to pull/push the images.