Docker image build

110 views
Skip to first unread message

Shuaib Hussain

unread,
Oct 8, 2021, 10:48:16 AM10/8/21
to rabbitmq-users
Hi,

I am seeking to build the 3.9.7 RabbitMQ image with OPT 23.3.2 but I get the following:

#8 167.2 + gosu rabbitmq rabbitmqctl help
#8 167.3 escript: exception error: undefined function rabbitmqctl_escript:main/1
#8 167.3   in function  escript:run/2 (escript.erl, line 758)
#8 167.3   in call from escript:start/1 (escript.erl, line 277)
#8 167.3   in call from init:start_em/1
#8 167.3   in call from init:do_boot/3

Michal Kuratczyk

unread,
Oct 8, 2021, 11:12:46 AM10/8/21
to rabbitm...@googlegroups.com
Hi,

You didn't provide the exact steps but if I remember correctly, this is related to the Erlang and/or Elixir version (or combination of both).
Why would you want to use Erlang 23? Erlang 24 is awesome, just use it. :)

Best,

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/1e481119-46e1-4fa3-9187-dc4998102e34n%40googlegroups.com.


--
Michał
RabbitMQ team

Shuaib Hussain

unread,
Oct 11, 2021, 4:59:00 AM10/11/21
to rabbitmq-users
Hi,

Yes, so you pull the rabbitmq repo which includes the dockerfile for creating the RabbitMQ image. Tha includes the following code:

#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#

# The official Canonical Ubuntu Focal image is ideal from a security perspective,
# especially for the enterprises that we, the RabbitMQ team, have to deal with
FROM ubuntu:20.04

RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
# grab gosu for easy step-down from root
gosu \
; \
rm -rf /var/lib/apt/lists/*; \
# verify that the "gosu" binary works
gosu nobody true

# Default to a PGP keyserver that pgp-happy-eyeballs recognizes, but allow for substitutions locally
ARG PGP_KEYSERVER=keyserver.ubuntu.com
# If you are building this image locally and are getting `gpg: keyserver receive failed: No data` errors,
# run the build with a different PGP_KEYSERVER, e.g. docker build --tag rabbitmq:3.8 --build-arg PGP_KEYSERVER=pgpkeys.eu 3.8/ubuntu
# For context, see https://github.com/docker-library/official-images/issues/4252

ENV OPENSSL_VERSION 1.1.1l
ENV OPENSSL_SOURCE_SHA256="0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1"
# https://www.openssl.org/community/omc.html
ENV OPENSSL_PGP_KEY_IDS="0x8657ABB260F056B1E5190839D9C4D26D0E604491 0x5B2545DAB21995F4088CEFAA36CEE4DEB00CFE33 0xED230BEC4D4F2518B9D7DF41F0DB4D21C1D35231 0xC1F33DD8CE1D4CC613AF14DA9195C48241FBF7DD 0x7953AC1FBC3DC8B3B292393ED5E9E43F7DF9EE8C 0xE5E52560DD91C556DDBDA5D02064C53641C25E5D"

ENV OTP_VERSION 23.3.2
# TODO add PGP checking when the feature will be added to Erlang/OTP's build system
# https://erlang.org/pipermail/erlang-questions/2019-January/097067.html
ENV OTP_SOURCE_SHA256="bb40ca2723fe51891850dc3bdf9e0409f195c73312e22e41e123ec55f26cc31f"

As you can see I've changed OTP_VERSION and its SHA256 to the relevant information.

If you do that for 3.9.7 then it will not work but it will work for 3.8.16? Even though in the following page:


It states that 3.9.7 can run with 23.3.2?

Shuaib

Michal Kuratczyk

unread,
Oct 11, 2021, 5:34:50 AM10/11/21
to rabbitm...@googlegroups.com
Hi,

RabbitMQ 3.9 does work with that Erlang version (although, again, you are going through some serious trouble to downgrade Erlang for no apparent reason - you will just end up maintaining a custom Docker image with worse performance). But to build an image like that, simply changing the Erlang version is clearly not sufficient.
The problem is RabbitMQ CLIs are written in Elixir, which is another language that works on the same Erlang VM. I believe what happens in your case is you end up with Elixir that was built on Erlang 24 (because you are modifying an image that assumes Erlang 24 is being used) but then you try to start the app on Erlang 23, which is not supported (RabbitMQ is not even in the picture - it's a matter of compatibility between compiled files and the virtual machine they were compiled for).

TL;DR:
1. I'd strongly recommend just using the image as is, with Erlang 24
2. If you really want to customise the image, you need to take care of the Elixir version as well, and make sure you don't try to run programs compiled using Erlang 24, on Erlang 23 virtual machine / runtime.

Best,



--
Michał
RabbitMQ team

Shuaib Hussain

unread,
Oct 11, 2021, 7:06:12 AM10/11/21
to rabbitmq-users
Hi,

The issue is that I am trying to upgrade from 3.8.7-management to 3.9.7-management in Kubernetes.

When I use a rolling update with following strategy:

updateStrategy:
type: RollingUpdate
rollingUpdate:
partition: 2

I can update to 3.8.15-management, but I cannot go further to 3.8.16-management+. I have also checked between 3.8.16-management to3.9.7-management+ and that works and it joins the cluster. How should I update it? Also I managed to create an image of 3.8.16-management with 23.3.2 erlang version and it still did not join the cluster?

What should I do to update RabbitMQ on a production system in Kubernetes without causing mass disruption and conducting a cluster migration that is our main challenge not building the image.

Shuaib

Shuaib Hussain

unread,
Oct 11, 2021, 7:15:37 AM10/11/21
to rabbitmq-users
Just to be more specific,

The 3.8.16-management node does not join the cluster which is at 3.8.15-management even when the 3.8.16-management image is running the exact same erlang version.

Also we want to update our RabbitMQ in production without a cluster migration.

Michal Kuratczyk

unread,
Oct 11, 2021, 7:35:19 AM10/11/21
to rabbitm...@googlegroups.com
I'd much rather focus on the actual upgrade issue, rather than building a custom image.
Can you please start a new thread with the actual issue you are facing, without any custom images in the picture?
Please provide logs and other details (`kubectl describe pod`, etc) and let's make sure you can upgrade.
Upgrading 3.8.15 to 3.8.16 should work. If there are problems - let's fix them, rather than building custom workarounds.

Best,




--
Michał

Shuaib Hussain

unread,
Oct 11, 2021, 8:08:03 AM10/11/21
to rabbitmq-users
Okay, I will make a new discussion. Thank you.
Reply all
Reply to author
Forward
0 new messages