brotandgames / ciao

HTTP checks & tests (private & public) monitoring - check the status of your URL
https://brotandgames.com/ciao/
MIT License
1.86k stars 99 forks source link

Docker build error. LoadError: cannot load such file -- sqlite3/sqlite3_native (LoadError) #156

Closed chaofan-nirvana closed 5 months ago

chaofan-nirvana commented 9 months ago

Describe the bug Docker build error. LoadError: cannot load such file -- sqlite3/sqlite3_native (LoadError)

To Reproduce Steps to reproduce the behavior:

  1. docker build .

Expected behavior No error

Screenshots

image

Additional context Downgrade to ruby:3.2.2-alpine3.18 resolves the issue.

image
chaofan-nirvana commented 9 months ago

The official image ruby:3.2.2-alpine changed five days ago from ruby:3.2.2-alpine3.18 to ruby:3.2.2-alpine3.19. But unfortunately, it did not work great with our sqlite gem.

brotandgames commented 9 months ago

Tried to reproduce the error:

  1. Downloaded the current ruby 3.2.2-alpine docker image via docker pull docker.io/library/ruby:3.2.2-alpine
❯ docker images
REPOSITORY   TAG            IMAGE ID       CREATED      SIZE
ruby         3.2.2-alpine   ffadc04b8417   6 days ago   84.1MB
  1. Built the ciao image with no errors
❯ docker build . --tag ciao
[+] Building 0.0s (14/14) FINISHED                                                                                                                           docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                                                         0.0s
 => => transferring dockerfile: 1.67kB                                                                                                                                       0.0s
 => [internal] load .dockerignore                                                                                                                                            0.0s
 => => transferring context: 526B                                                                                                                                            0.0s
 => [internal] load metadata for docker.io/library/ruby:3.2.2-alpine                                                                                                         0.0s
 => [1/9] FROM docker.io/library/ruby:3.2.2-alpine                                                                                                                           0.0s
 => [internal] load build context                                                                                                                                            0.0s
 => => transferring context: 19.18kB                                                                                                                                         0.0s
 => CACHED [2/9] RUN apk add --no-cache         sqlite-dev         tzdata         yarn                                                                                       0.0s
 => CACHED [3/9] WORKDIR /app                                                                                                                                                0.0s
 => CACHED [4/9] ADD Gemfile* /app/                                                                                                                                          0.0s
 => CACHED [5/9] RUN set -x     && apk add --no-cache --virtual .build-deps         build-base         libxml2-dev         libxslt-dev     && gem install bundler   && bund  0.0s
 => CACHED [6/9] COPY package.json yarn.lock /app/                                                                                                                           0.0s
 => CACHED [7/9] RUN set -x     && yarn install     && rm -rf /tmp/*                                                                                                         0.0s
 => CACHED [8/9] COPY . ./                                                                                                                                                   0.0s
 => CACHED [9/9] RUN set -x     && apk add --no-cache xz-libs gcompat     && SECRET_KEY_BASE=foo bundle exec rake assets:precompile     && rm -rf         /tmp/*         ap  0.0s
 => exporting to image                                                                                                                                                       0.0s
 => => exporting layers                                                                                                                                                      0.0s
 => => writing image sha256:85ceecd3837856a2069c3b92ee5c2f10a2bf8019b1a3e30c373a2e659031d448

 ❯ docker images
REPOSITORY   TAG            IMAGE ID       CREATED         SIZE
ciao         latest         85ceecd38378   9 minutes ago   324MB
ruby         3.2.2-alpine   ffadc04b8417   6 days ago      84.1MB

Everything works fine.

Could you please try the same and attach the output as code/txt instead of image(s)?

chaofan-nirvana commented 9 months ago

Sorry, I didn't give the output. Do you know if the digest is the same one? sha256:ea3d17c3ecc659b70f406a9550de3bc9bc0b6f99e6ba9d3f2c8eb9f2a0df2848 My processor is Intel Core i9 and macOS is 13.3.1 (a) (22E772610a)

(⎈|dr-dev:dev)➜  ciao git:(master) docker pull docker.io/library/ruby:3.2.2-alpine
3.2.2-alpine: Pulling from library/ruby
661ff4d9561e: Already exists
2d80d0587428: Already exists
c61efd3b4086: Already exists
b117bcabbe94: Already exists
be57016cec4f: Already exists
Digest: sha256:ea3d17c3ecc659b70f406a9550de3bc9bc0b6f99e6ba9d3f2c8eb9f2a0df2848
Status: Downloaded newer image for ruby:3.2.2-alpine
docker.io/library/ruby:3.2.2-alpine

(⎈|dr-dev:dev)➜  ciao git:(master) docker images|grep ruby
ruby                               3.2.2-alpine    2e0dcaa7f9ec   9 days ago      77.6MB

(⎈|dr-dev:dev)➜  ciao git:(master) docker build .
[+] Building 5.9s (13/13) FINISHED                                                                                                                                                                                          docker:orbstack
 => [internal] load build definition from Dockerfile                                                                                                                                                                                   0.0s
 => => transferring dockerfile: 1.67kB                                                                                                                                                                                                 0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                      0.0s
 => => transferring context: 526B                                                                                                                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/ruby:3.2.2-alpine                                                                                                                                                                   0.0s
 => [1/9] FROM docker.io/library/ruby:3.2.2-alpine                                                                                                                                                                                     0.0s
 => [internal] load build context                                                                                                                                                                                                      0.0s
 => => transferring context: 11.28kB                                                                                                                                                                                                   0.0s
 => CACHED [2/9] RUN apk add --no-cache         sqlite-dev         tzdata         yarn                                                                                                                                                 0.0s
 => CACHED [3/9] WORKDIR /app                                                                                                                                                                                                          0.0s
 => CACHED [4/9] ADD Gemfile* /app/                                                                                                                                                                                                    0.0s
 => CACHED [5/9] RUN set -x     && apk add --no-cache --virtual .build-deps         build-base         libxml2-dev         libxslt-dev     && gem install bundler   && bundle config set --local without 'development:test'     && bu  0.0s
 => CACHED [6/9] COPY package.json yarn.lock /app/                                                                                                                                                                                     0.0s
 => CACHED [7/9] RUN set -x     && yarn install     && rm -rf /tmp/*                                                                                                                                                                   0.0s
 => CACHED [8/9] COPY . ./                                                                                                                                                                                                             0.0s
 => ERROR [9/9] RUN set -x     && apk add --no-cache xz-libs gcompat     && SECRET_KEY_BASE=foo bundle exec rake assets:precompile     && rm -rf         /tmp/*         app/assets         lib/assets         node_modules         sp  5.8s
------
 > [9/9] RUN set -x     && apk add --no-cache xz-libs gcompat     && SECRET_KEY_BASE=foo bundle exec rake assets:precompile     && rm -rf         /tmp/*         app/assets         lib/assets         node_modules         spec         tmp/cache         vendor/assets:
0.095 + apk add --no-cache xz-libs gcompat
0.099 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
2.476 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
3.924 (1/4) Installing musl-obstack (1.2.3-r2)
4.077 (2/4) Installing libucontext (1.2-r2)
4.171 (3/4) Installing gcompat (1.1.0-r4)
4.263 (4/4) Installing xz-libs (5.4.5-r0)
4.403 OK: 88 MiB in 53 packages
4.460 + SECRET_KEY_BASE=foo bundle exec rake assets:precompile
5.642 rake aborted!
5.642 LoadError: cannot load such file -- sqlite3/sqlite3_native
5.642 /usr/local/bundle/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
5.642 /usr/local/bundle/gems/activesupport-6.1.7.5/lib/active_support/dependencies.rb:332:in `block in require'
5.642 /usr/local/bundle/gems/activesupport-6.1.7.5/lib/active_support/dependencies.rb:299:in `load_dependency'
5.642 /usr/local/bundle/gems/activesupport-6.1.7.5/lib/active_support/dependencies.rb:332:in `require'
(⎈|dr-dev:dev)➜  ciao git:(master) docker image history ruby:3.2.2-alpine
IMAGE          CREATED       CREATED BY                                      SIZE      COMMENT
2e0dcaa7f9ec   9 days ago    /bin/sh -c #(nop)  CMD ["irb"]                  0B
<missing>      9 days ago    /bin/sh -c mkdir -p "$GEM_HOME" && chmod 177…   0B
<missing>      9 days ago    /bin/sh -c #(nop)  ENV PATH=/usr/local/bundl…   0B
<missing>      9 days ago    /bin/sh -c #(nop)  ENV BUNDLE_SILENCE_ROOT_W…   0B
<missing>      9 days ago    /bin/sh -c #(nop)  ENV GEM_HOME=/usr/local/b…   0B
<missing>      9 days ago    /bin/sh -c set -eux;   apk add --no-cache --…   54.3MB
<missing>      9 days ago    /bin/sh -c #(nop)  ENV RUBY_DOWNLOAD_SHA256=…   0B
<missing>      9 days ago    /bin/sh -c #(nop)  ENV RUBY_VERSION=3.2.2       0B
<missing>      9 days ago    /bin/sh -c #(nop)  ENV RUBY_MAJOR=3.2           0B
<missing>      9 days ago    /bin/sh -c #(nop)  ENV LANG=C.UTF-8             0B
<missing>      9 days ago    /bin/sh -c set -eux;  mkdir -p /usr/local/et…   45B
<missing>      9 days ago    /bin/sh -c set -eux;  apk add --no-cache   b…   16MB
<missing>      11 days ago   /bin/sh -c #(nop)  CMD ["/bin/sh"]              0B
<missing>      11 days ago   /bin/sh -c #(nop) ADD file:1f4eb46669b5b6275…   7.38MB
(⎈|dr-dev:dev)➜  ciao git:(master) docker inspect ruby:3.2.2-alpine
[
    {
        "Id": "sha256:2e0dcaa7f9ec284987a3e9973628d7c570bb5573c575a64e6ce6f46c1dd7b8a2",
        "RepoTags": [
            "ruby:3.2.2-alpine"
        ],
        "RepoDigests": [
            "ruby@sha256:ea3d17c3ecc659b70f406a9550de3bc9bc0b6f99e6ba9d3f2c8eb9f2a0df2848"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2023-12-09T06:29:58.792816717Z",
        "Container": "86f33dd5868db9a2d3b7d9658e898c8cd3c3fa2ee3f85cb889c5902c9ce7e19f",
        "ContainerConfig": {
            "Hostname": "86f33dd5868d",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=C.UTF-8",
                "RUBY_MAJOR=3.2",
                "RUBY_VERSION=3.2.2",
                "RUBY_DOWNLOAD_SHA256=4b352d0f7ec384e332e3e44cdbfdcd5ff2d594af3c8296b5636c710975149e23",
                "GEM_HOME=/usr/local/bundle",
                "BUNDLE_SILENCE_ROOT_WARNING=1",
                "BUNDLE_APP_CONFIG=/usr/local/bundle"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ",
                "CMD [\"irb\"]"
            ],
            "Image": "sha256:f8d5eb6ba09f26e4be1acbd5ab0d529e8e9bd7bc173f91bb35c7f1965235bf8e",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {}
        },
        "DockerVersion": "20.10.23",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=C.UTF-8",
                "RUBY_MAJOR=3.2",
                "RUBY_VERSION=3.2.2",
                "RUBY_DOWNLOAD_SHA256=4b352d0f7ec384e332e3e44cdbfdcd5ff2d594af3c8296b5636c710975149e23",
                "GEM_HOME=/usr/local/bundle",
                "BUNDLE_SILENCE_ROOT_WARNING=1",
                "BUNDLE_APP_CONFIG=/usr/local/bundle"
            ],
            "Cmd": [
                "irb"
            ],
            "Image": "sha256:f8d5eb6ba09f26e4be1acbd5ab0d529e8e9bd7bc173f91bb35c7f1965235bf8e",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": null
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 77639504,
        "VirtualSize": 77639504,
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/27a74a8310979c8fc14942294b00a4c699749e4ab9d5b8bbef1b2f914822d18f/diff:/var/lib/docker/overlay2/31245ea901f4327d52032ec6373c0ae74ab3ec2f89512285ebdab45a058bff17/diff:/var/lib/docker/overlay2/3e7c97f09102ff6fffd941667ce02637c2a24ea8ab488621cf2327ec3e6d33a2/diff:/var/lib/docker/overlay2/8800dfa969dc5b4d92755178fe47307a36faaaff081b4d6b6730b88b4812040c/diff",
                "MergedDir": "/var/lib/docker/overlay2/f1918863bb6703301da7956a5842305617fda8199e2c997406187f085eb2649c/merged",
                "UpperDir": "/var/lib/docker/overlay2/f1918863bb6703301da7956a5842305617fda8199e2c997406187f085eb2649c/diff",
                "WorkDir": "/var/lib/docker/overlay2/f1918863bb6703301da7956a5842305617fda8199e2c997406187f085eb2649c/work"
            },
            "Name": "overlay2"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:5af4f8f59b764c64c6def53f52ada809fe38d528441d08d01c206dfb3fc3b691",
                "sha256:20ac955e65043ab6be8baedeeb92c0bcf70c0e93f24f58ef2b2a0d116115e970",
                "sha256:1d1413b16f59699bee0326fadeca4f8a18c5b948a1ea0570134215190d6f8087",
                "sha256:c873f3dab4ff664e4f13c6e4c6ab3323f553a942907cb8e5bdb697c6e37f65fd",
                "sha256:c33d2a2489fb6d32515f40d1ee9d26e7507d165ad4dd8a46eab43b6c115a375c"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]
brotandgames commented 9 months ago

Are you using Docker Desktop for macOS? If so, which version do you have installed (Docker Desktop > About)?

Please attach the output of the following commands.

  1. Check system version
❯ uname -a
Darwin <redacted> 21.6.0 Darwin Kernel Version 21.6.0: Wed Oct  4 23:54:48 PDT 2023; root:xnu-8020.240.18.704.15~1/RELEASE_ARM64_T8101 arm64
  1. Check docker version
❯ docker -v
Docker version 24.0.6, build ed223bc
  1. Remove image ruby:3.2.2-alpine
❯ docker image rm ruby:3.2.2-alpine
Untagged: ruby:3.2.2-alpine
Untagged: ruby@sha256:ea3d17c3ecc659b70f406a9550de3bc9bc0b6f99e6ba9d3f2c8eb9f2a0df2848
Deleted: sha256:ffadc04b8417acde166e22dfb6a6d80d1479683caf1e409f34cf3c6237ef842d
  1. Check docker images
❯ docker image ls | grep '[ruby|ciao]'
  1. Remove all build cache
❯ docker builder prune -a
  1. Build ciao image
❯ docker build . --tag ciao
[+] Building 117.8s (14/14) FINISHED                                                                   docker:desktop-linux
 => [internal] load .dockerignore                                                                                      0.0s
 => => transferring context: 526B                                                                                      0.0s
 => [internal] load build definition from Dockerfile                                                                   0.0s
 => => transferring dockerfile: 1.67kB                                                                                 0.0s
 => [internal] load metadata for docker.io/library/ruby:3.2.2-alpine                                                   1.6s
 => [1/9] FROM docker.io/library/ruby:3.2.2-alpine@sha256:ea3d17c3ecc659b70f406a9550de3bc9bc0b6f99e6ba9d3f2c8eb9f2a0d  9.5s
 => => resolve docker.io/library/ruby:3.2.2-alpine@sha256:ea3d17c3ecc659b70f406a9550de3bc9bc0b6f99e6ba9d3f2c8eb9f2a0d  0.0s
 => => sha256:ea3d17c3ecc659b70f406a9550de3bc9bc0b6f99e6ba9d3f2c8eb9f2a0df2848 1.65kB / 1.65kB                         0.0s
 => => sha256:d5de97563304fe4fff6f49dffab91a1073e9edada7e899869140c8eda394aaf7 1.36kB / 1.36kB                         0.0s
 => => sha256:ffadc04b8417acde166e22dfb6a6d80d1479683caf1e409f34cf3c6237ef842d 7.25kB / 7.25kB                         0.0s
 => => sha256:c303524923177661067f7eb378c3dd5277088c2676ebd1cd78e68397bb80fdbf 3.35MB / 3.35MB                         1.6s
 => => sha256:8febe9514bcbbd8570accd06c02a88cb13576a56f1088f7a3364e7ba9506802e 6.73MB / 6.73MB                         2.8s
 => => sha256:281d3abc84f91c3bb695753c827ae2e6ca7c68e0c7229e56a199f3013342e9c9 224B / 224B                             0.4s
 => => sha256:6e1a54bfddc61343c7384178924116c8c3ee01a3bd3248286ff8e382d1e9312e 32.08MB / 32.08MB                       8.7s
 => => extracting sha256:c303524923177661067f7eb378c3dd5277088c2676ebd1cd78e68397bb80fdbf                              0.1s
 => => sha256:e276298626bdc26c499c00e5de0e973c87742ecd2d24f943a8c532dd736fa0e2 171B / 171B                             2.2s
 => => extracting sha256:8febe9514bcbbd8570accd06c02a88cb13576a56f1088f7a3364e7ba9506802e                              0.3s
 => => extracting sha256:281d3abc84f91c3bb695753c827ae2e6ca7c68e0c7229e56a199f3013342e9c9                              0.0s
 => => extracting sha256:6e1a54bfddc61343c7384178924116c8c3ee01a3bd3248286ff8e382d1e9312e                              0.6s
 => => extracting sha256:e276298626bdc26c499c00e5de0e973c87742ecd2d24f943a8c532dd736fa0e2                              0.0s
 => [internal] load build context                                                                                      0.1s
 => => transferring context: 2.77MB                                                                                    0.1s
 => [2/9] RUN apk add --no-cache         sqlite-dev         tzdata         yarn                                        4.2s
 => [3/9] WORKDIR /app                                                                                                 0.0s
 => [4/9] ADD Gemfile* /app/                                                                                           0.0s
 => [5/9] RUN set -x     && apk add --no-cache --virtual .build-deps         build-base         libxml2-dev           92.4s
 => [6/9] COPY package.json yarn.lock /app/                                                                            0.0s
 => [7/9] RUN set -x     && yarn install     && rm -rf /tmp/*                                                          3.7s
 => [8/9] COPY . ./                                                                                                    0.0s
 => [9/9] RUN set -x     && apk add --no-cache xz-libs gcompat     && SECRET_KEY_BASE=foo bundle exec rake assets:pre  5.7s
 => exporting to image                                                                                                 0.5s
 => => exporting layers                                                                                                0.5s
 => => writing image sha256:e3cea7f6b4b8d1f776d30a3e0841dc74d005980983ccec40cdd8545378f872f8                           0.0s
 => => naming to docker.io/library/ciao
  1. Check docker images (again)
❯ docker image ls | grep '[ruby|ciao]'
ciao         latest    e3cea7f6b4b8   15 minutes ago   324MB
chaofan-nirvana commented 9 months ago

Thank you so much! The docker desktop I use is here.

image

I tried to do as you described but failed even after I removed all the images.

❯ docker rmi -f $(docker images -aq)
  1. Check system version
    ❯ uname -a
    Darwin jiang-pro.local 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar  6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64 x86_64
  2. Check docker version
    ❯ docker -v
    Docker version 24.0.7, build afdd53b
  3. Remove image ruby:3.2.2-alpine
    ❯ docker image rm ruby:3.2.2-alpine
    Untagged: ruby:3.2.2-alpine
    Untagged: ruby@sha256:ea3d17c3ecc659b70f406a9550de3bc9bc0b6f99e6ba9d3f2c8eb9f2a0df2848
    Deleted: sha256:2e0dcaa7f9ec284987a3e9973628d7c570bb5573c575a64e6ce6f46c1dd7b8a2
  4. Check docker images
    ❯ docker image ls | grep -E '(ruby|ciao)'
  5. Remove all build cache
    ❯ docker builder prune -a
  6. Build ciao image
    ❯ docker build . --tag ciao
    [+] Building 162.3s (14/14) FINISHED                                                                                                                                                                                   docker:desktop-linux
    => [internal] load build definition from Dockerfile                                                                                                                                                                                   0.0s
    => => transferring dockerfile: 1.67kB                                                                                                                                                                                                 0.0s
    => [internal] load .dockerignore                                                                                                                                                                                                      0.1s
    => => transferring context: 526B                                                                                                                                                                                                      0.0s
    => [internal] load metadata for docker.io/library/ruby:3.2.2-alpine                                                                                                                                                                   3.5s
    => [auth] library/ruby:pull token for registry-1.docker.io                                                                                                                                                                            0.0s
    => [1/9] FROM docker.io/library/ruby:3.2.2-alpine@sha256:ea3d17c3ecc659b70f406a9550de3bc9bc0b6f99e6ba9d3f2c8eb9f2a0df2848                                                                                                            14.1s
    => => resolve docker.io/library/ruby:3.2.2-alpine@sha256:ea3d17c3ecc659b70f406a9550de3bc9bc0b6f99e6ba9d3f2c8eb9f2a0df2848                                                                                                             0.0s
    => => sha256:661ff4d9561e3fd050929ee5097067c34bafc523ee60f5294a37fd08056a73ca 3.41MB / 3.41MB                                                                                                                                         5.7s
    => => sha256:2d80d058742871fff079c738b714f9397607debd820982b3a86091d06d3ec4c0 6.67MB / 6.67MB                                                                                                                                         7.8s
    => => sha256:c61efd3b4086e297aec14aaefac9c587d6128d93a43678762562e06bc45d1904 223B / 223B                                                                                                                                             0.4s
    => => sha256:ea3d17c3ecc659b70f406a9550de3bc9bc0b6f99e6ba9d3f2c8eb9f2a0df2848 1.65kB / 1.65kB                                                                                                                                         0.0s
    => => sha256:f687235cff8011482fa15415dd47fa5391833476cbc718a8df6a0fb3ff6ae920 1.36kB / 1.36kB                                                                                                                                         0.0s
    => => sha256:2e0dcaa7f9ec284987a3e9973628d7c570bb5573c575a64e6ce6f46c1dd7b8a2 7.24kB / 7.24kB                                                                                                                                         0.0s
    => => sha256:b117bcabbe94c3987fda59b140cd59579cf04619dd43bacb1969e5fdb79bb60a 32.01MB / 32.01MB                                                                                                                                      12.5s
    => => extracting sha256:661ff4d9561e3fd050929ee5097067c34bafc523ee60f5294a37fd08056a73ca                                                                                                                                              0.1s
    => => sha256:be57016cec4fc7d4ed7520496db12ad33d689986fd016211ca3a46d419d3fc40 173B / 173B                                                                                                                                             8.0s
    => => extracting sha256:2d80d058742871fff079c738b714f9397607debd820982b3a86091d06d3ec4c0                                                                                                                                              0.6s
    => => extracting sha256:c61efd3b4086e297aec14aaefac9c587d6128d93a43678762562e06bc45d1904                                                                                                                                              0.0s
    => => extracting sha256:b117bcabbe94c3987fda59b140cd59579cf04619dd43bacb1969e5fdb79bb60a                                                                                                                                              1.4s
    => => extracting sha256:be57016cec4fc7d4ed7520496db12ad33d689986fd016211ca3a46d419d3fc40                                                                                                                                              0.0s
    => [internal] load build context                                                                                                                                                                                                      0.1s
    => => transferring context: 279.90kB                                                                                                                                                                                                  0.0s
    => [2/9] RUN apk add --no-cache         sqlite-dev         tzdata         yarn                                                                                                                                                        7.0s
    => [3/9] WORKDIR /app                                                                                                                                                                                                                 0.0s
    => [4/9] ADD Gemfile* /app/                                                                                                                                                                                                           0.0s
    => [5/9] RUN set -x     && apk add --no-cache --virtual .build-deps         build-base         libxml2-dev         libxslt-dev     && gem install bundler   && bundle config set --local without 'development:test'     && bundle   126.5s
    => [6/9] COPY package.json yarn.lock /app/                                                                                                                                                                                            0.1s
    => [7/9] RUN set -x     && yarn install     && rm -rf /tmp/*                                                                                                                                                                          6.8s
    => [8/9] COPY . ./                                                                                                                                                                                                                    0.1s
    => ERROR [9/9] RUN set -x     && apk add --no-cache xz-libs gcompat     && SECRET_KEY_BASE=foo bundle exec rake assets:precompile     && rm -rf         /tmp/*         app/assets         lib/assets         node_modules         sp  4.1s
    ------
    > [9/9] RUN set -x     && apk add --no-cache xz-libs gcompat     && SECRET_KEY_BASE=foo bundle exec rake assets:precompile     && rm -rf         /tmp/*         app/assets         lib/assets         node_modules         spec         tmp/cache         vendor/assets:
    0.164 + apk add --no-cache xz-libs gcompat
    0.169 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
    0.889 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
    2.056 (1/4) Installing musl-obstack (1.2.3-r2)
    2.158 (2/4) Installing libucontext (1.2-r2)
    2.262 (3/4) Installing gcompat (1.1.0-r4)
    2.383 (4/4) Installing xz-libs (5.4.5-r0)
    2.534 OK: 88 MiB in 53 packages
    2.601 + SECRET_KEY_BASE=foo bundle exec rake assets:precompile
    3.984 rake aborted!
    3.984 LoadError: cannot load such file -- sqlite3/sqlite3_native
    3.984 /usr/local/bundle/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
    3.984 /usr/local/bundle/gems/activesupport-6.1.7.5/lib/active_support/dependencies.rb:332:in `block in require'
    3.984 /usr/local/bundle/gems/activesupport-6.1.7.5/lib/active_support/dependencies.rb:299:in `load_dependency'
    3.984 /usr/local/bundle/gems/activesupport-6.1.7.5/lib/active_support/dependencies.rb:332:in `require'
    3.984 /usr/local/bundle/gems/sqlite3-1.6.3-x86_64-linux/lib/sqlite3.rb:6:in `rescue in <main>'
    3.984 /usr/local/bundle/gems/sqlite3-1.6.3-x86_64-linux/lib/sqlite3.rb:2:in `<main>'
    3.984 /usr/local/bundle/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
    3.984 /usr/local/bundle/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/runtime.rb:55:in `each'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/runtime.rb:55:in `block in require'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/runtime.rb:44:in `each'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/runtime.rb:44:in `require'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler.rb:186:in `require'
    3.984 /app/config/application.rb:9:in `<top (required)>'
    3.984 /app/Rakefile:6:in `require_relative'
    3.984 /app/Rakefile:6:in `<top (required)>'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `load'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `kernel_load'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:23:in `run'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli.rb:486:in `exec'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli.rb:31:in `dispatch'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli.rb:25:in `start'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/exe/bundle:48:in `block in <top (required)>'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/exe/bundle:36:in `<top (required)>'
    3.984 /usr/local/bundle/bin/bundle:25:in `load'
    3.984 /usr/local/bundle/bin/bundle:25:in `<main>'
    3.984
    3.984 Caused by:
    3.984 LoadError: Error relocating /usr/local/bundle/gems/sqlite3-1.6.3-x86_64-linux/lib/sqlite3/3.2/sqlite3_native.so: posix_fallocate64: symbol not found - /usr/local/bundle/gems/sqlite3-1.6.3-x86_64-linux/lib/sqlite3/3.2/sqlite3_native.so
    3.984 /usr/local/bundle/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
    3.984 /usr/local/bundle/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
    3.984 /usr/local/bundle/gems/activesupport-6.1.7.5/lib/active_support/dependencies.rb:332:in `block in require'
    3.984 /usr/local/bundle/gems/activesupport-6.1.7.5/lib/active_support/dependencies.rb:299:in `load_dependency'
    3.984 /usr/local/bundle/gems/activesupport-6.1.7.5/lib/active_support/dependencies.rb:332:in `require'
    3.984 /usr/local/bundle/gems/sqlite3-1.6.3-x86_64-linux/lib/sqlite3.rb:4:in `<main>'
    3.984 /usr/local/bundle/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
    3.984 /usr/local/bundle/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/runtime.rb:55:in `each'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/runtime.rb:55:in `block in require'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/runtime.rb:44:in `each'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/runtime.rb:44:in `require'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler.rb:186:in `require'
    3.984 /app/config/application.rb:9:in `<top (required)>'
    3.984 /app/Rakefile:6:in `require_relative'
    3.984 /app/Rakefile:6:in `<top (required)>'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `load'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `kernel_load'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:23:in `run'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli.rb:486:in `exec'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli.rb:31:in `dispatch'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/cli.rb:25:in `start'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/exe/bundle:48:in `block in <top (required)>'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
    3.984 /usr/local/bundle/gems/bundler-2.3.26/exe/bundle:36:in `<top (required)>'
    3.984 /usr/local/bundle/bin/bundle:25:in `load'
    3.984 /usr/local/bundle/bin/bundle:25:in `<main>'
    3.984 (See full trace by running task with --trace)
    ------
    Dockerfile:45
    --------------------
    44 |     # https://nokogiri.org/tutorials/installing_nokogiri.html#linux-musl-error-loading-shared-library
    45 | >>> RUN set -x \
    46 | >>>     && apk add --no-cache xz-libs gcompat \
    47 | >>>     && SECRET_KEY_BASE=foo bundle exec rake assets:precompile \
    48 | >>>     # Remove folders not needed in resulting image
    49 | >>>     && rm -rf \
    50 | >>>         /tmp/* \
    51 | >>>         app/assets \
    52 | >>>         lib/assets \
    53 | >>>         node_modules \
    54 | >>>         spec \
    55 | >>>         tmp/cache \
    56 | >>>         vendor/assets
    57 |
    --------------------
    ERROR: failed to solve: process "/bin/sh -c set -x     && apk add --no-cache xz-libs gcompat     && SECRET_KEY_BASE=foo bundle exec rake assets:precompile     && rm -rf         /tmp/*         app/assets         lib/assets         node_modules         spec         tmp/cache         vendor/assets" did not complete successfully: exit code: 1
  7. Check docker images (again) No ciao image built
brotandgames commented 9 months ago

Can you try to add sqlite-dev to apk add --no-cache xz-libs gcompat (L46), build the image and post the resulting Dockerfile here?

chaofan-nirvana commented 9 months ago

Thank you so much! The result is the same as before. I think it's a sqlite issue please refer to https://github.com/sparklemotion/sqlite3-ruby/issues/434

brotandgames commented 8 months ago

While upgrading to ruby 3.3.0, encountered the same issue: https://github.com/brotandgames/ciao/actions/runs/7787978122/job/21236375464

brotandgames commented 8 months ago

Fix for this issue will be released after upgrade to ruby 3.3.1 (because of this bug in ruby 3.3.0: https://github.com/ruby/ruby/pull/9371)

brotandgames commented 5 months ago

Fixed in https://github.com/brotandgames/ciao/releases/tag/1.9.5