From 02e853e02c45e5493b2cb6ae75be316775a19e86 Mon Sep 17 00:00:00 2001 From: Paul Maksimovich Date: Wed, 12 Feb 2025 12:20:04 -0500 Subject: [PATCH] attempt to create erlang27 and build amd64 on mac silicon --- README.md | 2 +- bin/build | 4 +- runit-elixir-focal/{ => 25.3.2.13}/Dockerfile | 0 .../{ => 25.3.2.13}/collectd-socket.conf | 0 runit-elixir-focal/27.2.2/Dockerfile | 46 +++++++++++++++++++ .../27.2.2/collectd-socket.conf | 8 ++++ 6 files changed, 57 insertions(+), 3 deletions(-) rename runit-elixir-focal/{ => 25.3.2.13}/Dockerfile (100%) rename runit-elixir-focal/{ => 25.3.2.13}/collectd-socket.conf (100%) create mode 100644 runit-elixir-focal/27.2.2/Dockerfile create mode 100644 runit-elixir-focal/27.2.2/collectd-socket.conf diff --git a/README.md b/README.md index 510f5db..1e59b00 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Build all images in this project: Build a single image from this project, with support for specific versions: - $ bin/build name[/x.x] + $ BUILD_OPTS="--platform=linux/amd64" bin/build name[/x.x] ## Images diff --git a/bin/build b/bin/build index c5b0e5d..7d5b84a 100755 --- a/bin/build +++ b/bin/build @@ -26,10 +26,10 @@ function build_image() { if [ -n "$versions" ]; then for version in $versions; do - docker build $BUILD_OPTS -t ${NS}/$tag:$version $DIR/$subdir + docker buildx build $BUILD_OPTS -t ${NS}/$tag:$version $DIR/$subdir done else - docker build $BUILD_OPTS -t ${NS}/$tag $DIR/$subdir + docker buildx build $BUILD_OPTS -t ${NS}/$tag $DIR/$subdir fi } diff --git a/runit-elixir-focal/Dockerfile b/runit-elixir-focal/25.3.2.13/Dockerfile similarity index 100% rename from runit-elixir-focal/Dockerfile rename to runit-elixir-focal/25.3.2.13/Dockerfile diff --git a/runit-elixir-focal/collectd-socket.conf b/runit-elixir-focal/25.3.2.13/collectd-socket.conf similarity index 100% rename from runit-elixir-focal/collectd-socket.conf rename to runit-elixir-focal/25.3.2.13/collectd-socket.conf diff --git a/runit-elixir-focal/27.2.2/Dockerfile b/runit-elixir-focal/27.2.2/Dockerfile new file mode 100644 index 0000000..ea42cbf --- /dev/null +++ b/runit-elixir-focal/27.2.2/Dockerfile @@ -0,0 +1,46 @@ +FROM socrata/runit-focal AS base + +# Set up environment +ENV LANG C.UTF-8 + +# Install Java 8. If we start using this image for things other than +# one app, we might want to revisit this. +# +# The update-ca-certs call is to work around a bug in +# ca-certificates-java that results in missing Java certs +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775775 +RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confnew" --force-yes -fuy install software-properties-common && \ + DEBIAN_FRONTEND=noninteractive add-apt-repository -y ppa:openjdk-r/ppa && apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y install openjdk-8-jdk && \ + mkdir -p /opt && \ + update-ca-certificates -f + +FROM base AS build + +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install wget libncurses-dev libssl-dev + +RUN mkdir /build /opt/erlang /opt/elixir +WORKDIR /build + +RUN wget https://github.com/erlang/otp/releases/download/OTP-27.2.2/otp_src_27.2.2.tar.gz +RUN tar xzf otp_src_27.2.2.tar.gz +RUN cd otp_src_27.2.2 && ./configure --prefix=/opt/erlang && make && make install + +ENV PATH /opt/erlang/bin:$PATH + +RUN wget https://github.com/elixir-lang/elixir/archive/v1.18.2.tar.gz +RUN tar xzf v1.18.2.tar.gz +RUN cd elixir-1.18.2 && env PREFIX=/opt/elixir make install + +FROM base + +COPY --from=build /opt/ /opt/ + +ENV PATH /opt/erlang/bin:/opt/elixir/bin:$PATH + +# Add collectd config file +COPY collectd-socket.conf /etc/collectd/conf.d/socket.conf + +# LABEL must be last for proper base image discoverability +LABEL repository.socrata/runit-elixir-focal="" diff --git a/runit-elixir-focal/27.2.2/collectd-socket.conf b/runit-elixir-focal/27.2.2/collectd-socket.conf new file mode 100644 index 0000000..c18225c --- /dev/null +++ b/runit-elixir-focal/27.2.2/collectd-socket.conf @@ -0,0 +1,8 @@ +LoadPlugin unixsock + + + SocketFile "/var/run/collectd-unixsock" + SocketGroup "collectd" + SocketPerms "0777" + DeleteSocket true +