From 1a235c96a0d76947635a9fd9909c22f3b1acc463 Mon Sep 17 00:00:00 2001 From: Bitcoin Tools <156422466+bitcoin-tools@users.noreply.github.com> Date: Thu, 4 Apr 2024 00:58:19 -0400 Subject: [PATCH] feat(portability): add Dockerfile for Amazon Linux (#505) * Create Dockerfile_amazon * feat(ci): add Amazon Linux Dockerfile * fix: install xargs on Amazon Linux * improve the CI matrix names * fix: install `findutils` to add `xargs` * fix: allow erasing conflicting dependencies * try using gnupg2 in Amazon Linux * try --allowerasing when installing gnupg2 * fix: add replacement for gnupg2 --- .github/workflows/validation.yaml | 2 ++ dockerfiles/Dockerfile_amazon | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 dockerfiles/Dockerfile_amazon diff --git a/.github/workflows/validation.yaml b/.github/workflows/validation.yaml index 4c06082c1..4995391ea 100644 --- a/.github/workflows/validation.yaml +++ b/.github/workflows/validation.yaml @@ -162,6 +162,8 @@ jobs: include: - container: Alpine dockerfile: ./dockerfiles/Dockerfile_alpine + - container: Amazon + dockerfile: ./dockerfiles/Dockerfile_amazon - container: Arch dockerfile: ./dockerfiles/Dockerfile_arch - container: Debian diff --git a/dockerfiles/Dockerfile_amazon b/dockerfiles/Dockerfile_amazon new file mode 100644 index 000000000..0b9416f8a --- /dev/null +++ b/dockerfiles/Dockerfile_amazon @@ -0,0 +1,26 @@ +# syntax=docker/dockerfile:1 +# Amazon Linux is a Linux server operating system from AWS, optimized for EC2. +# This Dockerfile is ideal for applications that are deployed on AWS and require seamless integration. +FROM amazonlinux:2023 +ENV TERM=xterm + +# Define the dependencies URL +ARG DEPENDENCIES_URL=https://github.com/bitcoin-tools/nodebuilder/raw/master/dependencies.txt + +# Check the current environment +RUN uname -a \ + && cat /etc/os-release \ + && df -h \ + && grep Mem /proc/meminfo \ + && date -u + +# Install system updates and dependencies +RUN dnf makecache \ + && dnf --allowerasing --assumeyes install findutils \ + && curl --fail --silent --show-error --location "${DEPENDENCIES_URL}" \ + | awk '{if ($0 == "gnupg") print "gnupg2"; else print $0;}' \ + | xargs dnf --allowerasing --assumeyes install \ + && dnf clean all + +# Download and execute the script +RUN /bin/sh -c "$(curl -fsSL https://github.com/bitcoin-tools/nodebuilder/raw/master/nodebuilder)"