GIScience / ors-map-client

Openrouteservice API web SPA client using VueJS, Vuetify and Vue2Leaflet
http://maps.openrouteservice.org
Apache License 2.0
106 stars 32 forks source link

Docker Container fails to build due to git version pinning #343

Closed rkost closed 1 year ago

rkost commented 1 year ago

Greetings!

It seems that your provided Dockerfile pins git to a specific version which is why docker-compose fails to build the container on my machine (see log output below). Removing =2.38.4-r0 from the docker file resolves that issue for me. Is there a specific reason to pin git to that version?

https://github.com/GIScience/ors-map-client/blob/9da6f3164d176bfa2cb5b2d6f08b5107b02c8871/Dockerfile#L7

 rkost@rkost-arch-wkst  ~/repos/osm/ors-map-client   main ±  docker-compose build
[+] Building 2.2s (9/20)
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                      0.1s
 => => transferring dockerfile: 1.10kB                                                                                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                         0.1s
 => => transferring context: 214B                                                                                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/nginx:stable-alpine                                                                                                                                                                                    1.1s
 => [internal] load metadata for docker.io/library/node:16-alpine                                                                                                                                                                                         1.2s
 => [production-stage 1/5] FROM docker.io/library/nginx:stable-alpine@sha256:a9e4fce28ad7cc7de45772686a22dbeaeeb54758b16f25bf8f64ce33f3bff636                                                                                                             0.0s
 => [build-stage  1/10] FROM docker.io/library/node:16-alpine@sha256:fcb03294d3c0695cf9762dec94c0366f08e7a8c6a3c1e062d38c80ac30684d8a                                                                                                                     0.0s
 => [internal] load build context                                                                                                                                                                                                                         0.1s
 => => transferring context: 59.46kB                                                                                                                                                                                                                      0.0s
 => CACHED [build-stage  2/10] WORKDIR /opt/client/                                                                                                                                                                                                       0.0s
 => ERROR [build-stage  3/10] RUN apk --no-cache add build-base=0.5-r3 git=2.38.4-r0     && npm install -g pnpm@7.26.2                                                                                                                                    0.8s
------
 > [build-stage  3/10] RUN apk --no-cache add build-base=0.5-r3 git=2.38.4-r0     && npm install -g pnpm@7.26.2:
#0 0.429 fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
#0 0.640 fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
#0 0.773 ERROR: unable to select packages:
#0 0.791   git-2.38.4-r1:
#0 0.791     breaks: world[git=2.38.4-r0]
------
failed to solve: process "/bin/sh -c apk --no-cache add build-base=0.5-r3 git=2.38.4-r0     && npm install -g pnpm@7.26.2" did not complete successfully: exit code: 1
 ✘ rkost@rkost-arch-wkst  ~/repos/osm/ors-map-client   main ±  uname -a
Linux rkost-arch-wkst 6.2.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 13 Mar 2023 17:02:08 +0000 x86_64 GNU/Linux
 rkost@rkost-arch-wkst  ~/repos/osm/ors-map-client   main ±  docker --version
Docker version 23.0.1, build a5ee5b1dfc
 rkost@rkost-arch-wkst  ~/repos/osm/ors-map-client   main ±  docker-compose --version
Docker Compose version 2.16.0
MichaelsJP commented 1 year ago

@rkost Thanks for reporting. In deed, it's generally considered good practice to pin the versions. see https://github.com/hadolint/hadolint/wiki/DL3018. It makes it easier to reproduce errors (like this now, even if it's not the prime example)... :grin:

Fixed versions make sure the images work as expected, but it's definitely too harsh to pin the versions on the -Rx level. I've set the version pins more relaxed now, so that minor versions can actually differ.