cardano-foundation / cardano-graphql

GraphQL API for Cardano
Apache License 2.0
262 stars 104 forks source link

Docker build fails with version 8.2.1(Amazon Linux2) #886

Closed niso1985 closed 3 months ago

niso1985 commented 3 months ago

Summary

When I run docker-compose build with version 8.2.1 on my Amazon Linux 2 environment, I encounter the following error.

Steps to reproduce the bug

git pull and docker-compose build.

Actual Result

# docker-compose build
postgres uses an image, skipping
cardano-node uses an image, skipping
ogmios uses an image, skipping
cardano-db-sync uses an image, skipping
Building hasura
[+] Building 0.1s (7/7) FINISHED                                                                                                                                                                                                             docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                   0.0s
 => => transferring dockerfile: 519B                                                                                                                                                                                                                   0.0s
 => [internal] load metadata for docker.io/hasura/graphql-engine:v2.17.1.cli-migrations-v2                                                                                                                                                             0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                                                                                                                        0.0s
 => [internal] load build context                                                                                                                                                                                                                      0.0s
 => => transferring context: 42B                                                                                                                                                                                                                       0.0s
 => [1/2] FROM docker.io/hasura/graphql-engine:v2.17.1.cli-migrations-v2                                                                                                                                                                               0.0s
 => CACHED [2/2] COPY docker-entrypoint.sh /bin/                                                                                                                                                                                                       0.0s
 => exporting to image                                                                                                                                                                                                                                 0.0s
 => => exporting layers                                                                                                                                                                                                                                0.0s
 => => writing image sha256:d53aa723972523b612ffb8d72724ada3f0923fa4b823289634a5f0e2e5f17df0                                                                                                                                                           0.0s
 => => naming to docker.io/cardanofoundation/cardano-graphql-hasura:8.2.1                                                                                                                                                                              0.0s
Building background
[+] Building 0.4s (9/36)                                                                                                                                                                                                                     docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                   0.0s
 => => transferring dockerfile: 6.17kB                                                                                                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                                                                                                                        0.0s
 => [internal] load metadata for docker.io/frolvlad/alpine-glibc:alpine-3.11_glibc-2.30                                                                                                                                                                0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                      0.0s
 => => transferring context: 63B                                                                                                                                                                                                                       0.0s
 => [internal] load build context                                                                                                                                                                                                                      0.0s
 => => transferring context: 32.27kB                                                                                                                                                                                                                   0.0s
 => CACHED [ubuntu-nodejs 1/2] FROM docker.io/library/ubuntu:20.04                                                                                                                                                                                     0.0s
 => CACHED [downloader 1/5] FROM docker.io/frolvlad/alpine-glibc:alpine-3.11_glibc-2.30                                                                                                                                                                0.0s
 => ERROR [downloader 2/5] RUN apk add curl                                                                                                                                                                                                            0.3s
 => ERROR [ubuntu-nodejs 2/2] RUN apt-get update && apt-get install curl -y &&  curl --proto '=https' --tlsv1.2 -sSf -L https://deb.nodesource.com/setup_18.x | bash - &&  apt-get install nodejs -y                                                   0.3s
------
 > [downloader 2/5] RUN apk add curl:
0.105 Incorrect Usage: flag provided but not defined: -keep
0.105
0.105 NAME:
0.105    runc run - create and run a container
0.105
0.105 USAGE:
0.105    runc run [command options] <container-id>
0.105
0.105 Where "<container-id>" is your name for the instance of the container that you
0.105 are starting. The name you provide for the container instance must be unique on
0.105 your host.
0.105
0.105 DESCRIPTION:
0.105    The run command creates an instance of a container for a bundle. The bundle
0.105 is a directory with a specification file named "config.json" and a root
0.105 filesystem.
0.105
0.105 The specification file includes an args parameter. The args parameter is used
0.105 to specify command(s) that get run when the container is started. To change the
0.105 command(s) that get executed on start, edit the args parameter of the spec. See
0.105 "runc spec --help" for more explanation.
0.105
0.105 OPTIONS:
0.106    --bundle value, -b value  path to the root of the bundle directory, defaults to the current directory
0.106    --console-socket value    path to an AF_UNIX socket which will receive a file descriptor referencing the master end of the console's pseudoterminal
0.106    --detach, -d              detach from the container's process
0.106    --pid-file value          specify the file to write the process id to
0.106    --no-subreaper            disable the use of the subreaper used to reap reparented processes
0.106    --no-pivot                do not use pivot root to jail process inside rootfs.  This should be used whenever the rootfs is on top of a ramdisk
0.106    --no-new-keyring          do not create a new session keyring for the container.  This will cause the container to inherit the calling processes session key
0.106    --preserve-fds value      Pass N additional file descriptors to the container (stdio + $LISTEN_FDS + N in total) (default: 0)
0.106
0.107 flag provided but not defined: -keep
------
------
 > [ubuntu-nodejs 2/2] RUN apt-get update && apt-get install curl -y &&  curl --proto '=https' --tlsv1.2 -sSf -L https://deb.nodesource.com/setup_18.x | bash - &&  apt-get install nodejs -y:
0.124 Incorrect Usage: flag provided but not defined: -keep
0.124
0.125 NAME:
0.125    runc run - create and run a container
0.125
0.125 USAGE:
0.125    runc run [command options] <container-id>
0.125
0.125 Where "<container-id>" is your name for the instance of the container that you
0.125 are starting. The name you provide for the container instance must be unique on
0.125 your host.
0.125
0.125 DESCRIPTION:
0.125    The run command creates an instance of a container for a bundle. The bundle
0.125 is a directory with a specification file named "config.json" and a root
0.125 filesystem.
0.125
0.125 The specification file includes an args parameter. The args parameter is used
0.125 to specify command(s) that get run when the container is started. To change the
0.125 command(s) that get executed on start, edit the args parameter of the spec. See
0.125 "runc spec --help" for more explanation.
0.125
0.125 OPTIONS:
0.125    --bundle value, -b value  path to the root of the bundle directory, defaults to the current directory
0.125    --console-socket value    path to an AF_UNIX socket which will receive a file descriptor referencing the master end of the console's pseudoterminal
0.125    --detach, -d              detach from the container's process
0.125    --pid-file value          specify the file to write the process id to
0.125    --no-subreaper            disable the use of the subreaper used to reap reparented processes
0.125    --no-pivot                do not use pivot root to jail process inside rootfs.  This should be used whenever the rootfs is on top of a ramdisk
0.125    --no-new-keyring          do not create a new session keyring for the container.  This will cause the container to inherit the calling processes session key
0.125    --preserve-fds value      Pass N additional file descriptors to the container (stdio + $LISTEN_FDS + N in total) (default: 0)
0.125
0.126 flag provided but not defined: -keep
------
Dockerfile:36
--------------------
  34 |
  35 |     FROM frolvlad/alpine-glibc:alpine-3.11_glibc-2.30 AS downloader
  36 | >>> RUN apk add curl
  37 |     RUN curl --proto '=https' --tlsv1.2 -sSf -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | sh
  38 |     ENV HASURA_GRAPHQL_ENABLE_TELEMETRY=false
--------------------
ERROR: failed to solve: process "/bin/sh -c apk add curl" did not complete successfully: exit code: 1
ERROR: Service 'background' failed to build : Build failed

Expected Result

build successfully

Environment

{
  os: {
    arch: 'x64',
    cpus: {
      count: 16,
      model: 'Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz'
    },
    release: '4.14.262-200.489.amzn2.x86_64',
    totalMem: 66476650496,
    type: 'Linux'
  },
  version: '8.0.0'
}

Platform

Platform version

Amazon Linux2

Runtime

Runtime version

docker v25.0.5

niso1985 commented 3 months ago

Probably due to the fact that the relevant version of glibc is not supported by amazon linux2. Is there any other solution but to create a new environment?

niso1985 commented 3 months ago

Sorry, I solved the problem by bringing the runc version up to date. Since hardfork is so close I wanted to seek an answer right away.

Kammerlo commented 3 months ago

No worries! I'm glad you found it.