alpinelinux / docker-alpine

Official Alpine Linux Docker image. Win at minimalism!
MIT License
1.04k stars 261 forks source link

RUN apk add --no-cache jpeg-dev zlib-dev ---> Not Working #143

Open AFTAB685 opened 3 years ago

AFTAB685 commented 3 years ago

Hi

I am building image using Dockerfile and trying to install Pillow , but it is producing error .

Here is snippet from docker file

FROM python:3.8-alpine
ARG http_proxy
ARG https_proxy

RUN apk add --no-cache jpeg-dev zlib-dev
RUN apk add --no-cache --virtual .build-deps build-base linux-headers ca-certificates
COPY certs/* /usr/local/share/ca-certificates/
RUN update-ca-certificates

COPY pip.conf /etc/pip.conf
RUN python -m pip --cert /usr/local/share/ca-certificates/cacert.pem install --upgrade pip
---------------------------------
----------------------------------------

and the error I am getting is

Step 4/22 : RUN apk add --no-cache jpeg-dev zlib-dev
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (windows/amd64) and no specific platform was requested
 ---> Running in 5eb03d8dbfc0
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.13/main: temporary error (try again later)
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.13/community: temporary error (try again later)
ERROR: unable to select packages:
  jpeg-dev (no such package):
    required by: world[jpeg-dev]
  zlib-dev (no such package):
    required by: world[zlib-dev]
The command '/bin/sh -c apk add --no-cache jpeg-dev zlib-dev' returned a non-zero code: 4294967295: failed to shutdown container: container 5eb03d8dbfc0724cb9058d412bf42b328eba750e059e7771142c7a6a44d96e9a encountered an error during hcsshim::System::waitBackground: failure in a Windows system call: The virtual machine or container with the specified identifier is not running. (0xc0370110): subsequent terminate failed container 5eb03d8dbfc0724cb9058d412bf42b328eba750e059e7771142c7a6a44d96e9a encountered an error during hcsshim::System::waitBackground: failure in a Windows system call: The virtual machine or container with the specified identifier is not running. (0xc0370110)

Please help

antoinne-williams commented 3 years ago

I'm seeing similar issues (Permission denied instead of "temporary error (try again later)") when using the base alpine image and attempting to install curl, jq and privoxy:

Step 3/9 : RUN apk add --no-cache -U curl privoxy jq &&     mv /etc/privoxy/templates /etc/privoxy-templates &&     rm -rf /var/cache/apk/* /etc/privoxy/* &&     mv /etc/privoxy-templates /etc/privoxy/templates
 ---> Running in b2340e525bc8
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.13/main: Permission denied
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.13/community: Permission denied
ERROR: unable to select packages:
  curl (no such package):
    required by: world[curl]
  jq (no such package):
    required by: world[jq]
  privoxy (no such package):
    required by: world[privoxy]

In my scenario and @AFTAB685's example, we are both attempting to reach: https://dl-cdn.alpinelinux.org/alpine/v3.13/main https://dl-cdn.alpinelinux.org/alpine/v3.13/community

I have also attempted to downgrade the alpine version by tagging :3.12 and :3.11 (to use their associated repos) with the same results (also added a directive to change the https to http with sed (not preferred, but used as a troubleshooting step, if nothing else) with no change.