singlestore-labs / singlestoredb-dev-image

The SingleStoreDB Dev Container is the fastest way to develop with SingleStore on your laptop or in a CI/CD environment.
Apache License 2.0
40 stars 15 forks source link

Creating custom singlestoredb-dev with build.sh is broken #79

Closed inianv closed 2 months ago

inianv commented 2 months ago

Describe the bug The current build.sh script to create a custom singlestoredb-dev is broken because the GPG keys for AlmaLinux 8 has changed since the script was last modified. Need to import the latest keys for package installation to work.

To Reproduce Steps to reproduce the behavior:

  1. Clone the latest master branch
  2. Set the BOOTSTRAP_LICENSE to a valid license using export
  3. Run ./build.sh to build the local image
  4. Observe the error
 => ERROR [ 2/26] RUN dnf upgrade -y almalinux-release &&     yum -y clean all                                                                                                                                  6.4s
------
 > [ 2/26] RUN dnf upgrade -y almalinux-release &&     yum -y clean all:
1.056 AlmaLinux 8 - BaseOS                            5.9 MB/s | 4.0 MB     00:00
2.317 AlmaLinux 8 - AppStream                          16 MB/s |  11 MB     00:00
4.407 AlmaLinux 8 - Extras                             34 kB/s |  21 kB     00:00
4.920 Dependencies resolved.
4.921 ================================================================================
4.921  Package                  Architecture  Version             Repository     Size
4.921 ================================================================================
4.921 Upgrading:
4.921  almalinux-release        x86_64        8.10-1.el8          baseos         27 k
4.921
4.921 Transaction Summary
4.921 ================================================================================
4.921 Upgrade  1 Package
4.921
4.921 Total download size: 27 k
4.922 Downloading Packages:
5.540 almalinux-release-8.10-1.el8.x86_64.rpm         3.3 MB/s |  27 kB     00:00
5.540 --------------------------------------------------------------------------------
5.540 Total                                            43 kB/s |  27 kB     00:00
5.552 AlmaLinux 8 - BaseOS                            3.3 MB/s | 3.4 kB     00:00
5.621 Importing GPG key 0xC21AD6EA:
5.621  Userid     : "AlmaLinux <packager@almalinux.org>"
5.621  Fingerprint: E53C F5EF 91CE B0AD 1812 ECB8 51D6 647E C21A D6EA
5.621  From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
5.622 Key imported successfully
5.632 Import of key(s) didn't help, wrong key(s)?
5.632 Public key for almalinux-release-8.10-1.el8.x86_64.rpm is not installed. Failing package is: almalinux-release-8.10-1.el8.x86_64
5.632  GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
5.632 The downloaded packages were saved in cache until the next successful transaction.
5.632 You can remove cached packages by executing 'dnf clean packages'.
5.634 Error: GPG check FAILED
------
Dockerfile:5
--------------------
   4 |
   5 | >>> RUN dnf upgrade -y almalinux-release && \
   6 | >>>     yum -y clean all
   7 |
--------------------
ERROR: failed to solve: process "/bin/sh -c dnf upgrade -y almalinux-release &&     yum -y clean all" did not complete successfully: exit code: 1

Expected behavior The singlestoredb-dev docker image to be created successfully with the local tag, which didn't happen.

Additional context Add any other context about the problem here.

inianv commented 2 months ago

Fix is to add the instruction after line 2 in the Dockerfile as below.

RUN rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux

With the above change, the docker image is built successfully,

...
 => [21/27] ADD scripts/memsqlctl /bin/memsqlctl                                                                                                                                                                0.0s
 => [22/27] ADD scripts/init.sh /scripts/init.sh                                                                                                                                                                0.0s
 => [23/27] RUN /scripts/init.sh "BDBkMTllNTkxYmJlNDRlN2U5ZWYyM2YzZDRmN2YwY2FmAAAAAAAAAAAEAAAAAAAAACgwNQIZALfDACVybqBaHxUHdjHEfTPECqOfdquMVwIYUKDroCKPtLk0qAuwzFHh5L6GxwTw9vDzAA=="                            44.5s
 => [24/27] ADD scripts/switch-version.sh /scripts/switch-version.sh                                                                                                                                            0.1s
 => [25/27] ADD scripts/start.sh /scripts/start.sh                                                                                                                                                              0.0s
 => [26/27] ADD licenses /licenses                                                                                                                                                                              0.0s
 => [27/27] ADD scripts/healthcheck.sh /scripts/healthcheck.sh                                                                                                                                                  0.0s
 => exporting to image                                                                                                                                                                                          1.8s
 => => exporting layers                                                                                                                                                                                         1.8s
 => => writing image sha256:9c5a1eb930f6c6169e115ce90596bccc11041785cc0c6dcecc5f33cca2c3e153                                                                                                                    0.0s
 => => naming to ghcr.io/singlestore-labs/singlestoredb-dev:local  

Don't have permissions to commit to the repo, else would have raised a PR.

pvetere commented 2 months ago

Hi @inianv, thank you very much for bringing this to our attention! I'll fix it.

pvetere commented 2 months ago

Fixed. Thanks again!