I am trying to build an image for a django project. I tried ”’sudo docker login”’, after that also same error message. tried in macOS M1 & rasberrypi 4B.
**Dockerfile:
FROM python3.9.2-slim
ENV PYTHONUNBUFFERED 1
RUN sudo apt update -y && sudo apt upgrade -y
RUN mkdir /app
WORKDIR /app
COPY requirements.txt /app/
RUN pip install --user -r requirements.txt
COPY . /app/
CMD python3 manage.py runserver
Output(sudo docker build . -t ttapp-image):
[+] Building 2.1s (4/4) FINISHED docker:default
=> [internal] load build definition from Dockerfi 0.0s
=> => transferring dockerfile: 279B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> ERROR [internal] load metadata for docker.io/l 2.0s
=> [auth] library/python3.9.2-slim:pull token for 0.0s
------
> [internal] load metadata for docker.io/library/python3.9.2-slim:latest:
------
Dockerfile:1
--------------------
1 | >>> FROM python3.9.2-slim
2 |
3 | ENV PYTHONUNBUFFERED 1
--------------------
ERROR: failed to solve: python3.9.2-slim: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
2
Answers
Change image from
python3.9.2-slim
topython:3.9.2-slim
.Just a couple of suggestions to your dockerfile that may help solve the problem.
you dont have to specify the complete image name and tag..instead use
You also dont need to use sudo inside docker. Docker runs the commands as root user by default unless specified. instead use..