vuestorefront / vue-storefront-api

Vue.js storefront for Magento2 (and not only) - data backend
https://www.vuestorefront.io
MIT License
348 stars 338 forks source link

Error while fetching: apk add --no-cache curl git #504

Closed neelaryan closed 4 years ago

neelaryan commented 4 years ago

Hey guys,

I am getting this weird error while trying to execute the Docker command from https://docs.vuestorefront.io/guide/cookbook/setup.html#_2-recipe

[docker@docker vue-storefront-api-1.12.3]$ docker-compose -f docker-compose.yml -f docker-compose.nodejs.yml up -d
Building app
Step 1/9 : FROM node:10-alpine
 ---> 8e473595b853
Step 2/9 : ENV VS_ENV prod
 ---> Using cache
 ---> 89b96501c54f
Step 3/9 : WORKDIR /var/www
 ---> Using cache
 ---> fb7ae8032c40
Step 4/9 : RUN apk add --no-cache curl git
 ---> Running in e07f9f2b4c70
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz: temporary error (try again later)
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz: temporary error (try again later)
ERROR: unsatisfiable constraints:
  curl (missing):
    required by: world[curl]
  git (missing):
    required by: world[git]
ERROR: Service 'app' failed to build: The command '/bin/sh -c apk add --no-cache curl git' returned a non-zero code: 2
[docker@docker vue-storefront-api-1.12.3]$

Running CentOS 8.2 on XenServer 8.2, Docker: Docker version 19.03.12, build 48a66213fe Docker-CE: Docker version 18.09.1, build 4c52b90

Edit: Installed similar versions of Docker. Did not help!

docker-ce-18.09.1-3.el7.x86_64.rpm
docker-ce-cli-18.09.1-3.el7.x86_64.rpm
containerd.io-1.2.0-3.el7.x86_64
neelaryan commented 4 years ago

Added firewalld entries for CentOS to allow HTTP/S access from containers.

Commands for anyone else facing similar issue:

firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --reload

Source; https://stackoverflow.com/a/63067436/3211474