5

I'm trying to install git-lfs in a Docker alpine image, but I'm getting an error indicating:

ERROR: unsatisfiable constraints:
git-lfs (missing):
required by: world[git-lfs]

It seems that there has been many issues related to apk not finding packages (see here and there), and in many cases these have been solved by using the --no-cache option with apk add. But I am not being that lucky and cannot understand the origin of this error, specially considering that git-lfs is up to date in alpine repo.

The following small Dockerfile should reproduce the error:

FROM alpine:3.4

RUN apk update && apk add --no-cache \
        build-base \
        git \
        git-lfs
elcortegano
  • 2,444
  • 11
  • 40
  • 58

1 Answers1

7

The problem is that git-lfs is available only from alpine:3.7.

To fix the issue you should either rebuild it on your own or use an alpine version >=3.7.

Btw, you don't need to execute apk update.

Stefano
  • 4,730
  • 1
  • 20
  • 28
  • This fixes the problem indeed, Thank you. Just for knowing in the future, is it possible to know in advance if one package requires a given version of alpine or not? To me is not obvious from the package website. – elcortegano Oct 09 '19 at 15:49
  • 1
    to be honest, I did it in a unpleasant way... This is the address: https://pkgs.alpinelinux.org/package/v3.7/community/x86/git-lfs from here I tried to go back with versions to see if it was available... Not the nicest way :P – Stefano Oct 09 '19 at 15:55
  • 1
    That what I call brute force! But no doubt it works :D – elcortegano Oct 09 '19 at 15:56