Google cloud build running into "unsatisfiable constraints" error (image builds locally)

601 views Asked by At

My Dckerfile

FROM python:3.7-alpine

ADD requirements.txt /code/requirements.txt

RUN apk --no-cache add --virtual build-dependencies \
  build-base \
  py-mysqldb \
  gcc \
  libc-dev \
  libffi-dev \
  mariadb-dev \
  && pip install -r /code/requirements.txt \
  && rm -rf .cache/pip \
  && apk del build-dependencies

RUN apk -q --no-cache add mariadb-client-libs

COPY . /code
...

I am able to build the image locally.

But when google (cloud build) tries to build the image I get the following error:

...
(28/28) Purging python2 (2.7.15-r0)
Executing busybox-1.28.4-r0.trigger
OK: 17 MiB in 34 packages
Removing intermediate container bc1fb0b1da92
---> bf2c564de5a5
Step 4/7 : RUN apk -q --no-cache add mariadb-client-libs
---> Running in 9c4fcad1f632
ERROR: unsatisfiable constraints:
**mariadb-client-libs (missing):**
required by: world[mariadb-client-libs]
The command '**/bin/sh -c apk -q --no-cache add mariadb-client-libs**' returned a non-zero code: 1
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1

A quick search online suggested that the repo could be offline, but I doubt that's the case. It seems Google Cloud build is blocking the access to the repo. Anyone else run into this issue? Any pointers on how to fix this?

1

There are 1 answers

0
Prashant On

On @helado's suggestion, I'm posting my comment from above as the answer:

@helado: I hesitated from posting this as the answer as its a solution that bypasses the problem. But i think the more important point is an issue like this should'nt stop folks from making progress :)

---- Copy pasted comment from above ----

It works for me when I try to build it locally, but fails on google cloud. Also, its not the correct way to solve the problem, but I switched my dependency form mariadb-client-libs to py-mysqldb and all is working now. Just in case it helps you :)