Changes for the ARM64 architecture for Raspberry Pi-5

This commit is contained in:
Calabro, Brandon
2025-10-10 11:01:34 -05:00
parent 789d074f14
commit a688ae3f04
5 changed files with 40 additions and 36 deletions

View File

@@ -1,7 +1,6 @@
FROM ubuntu:18.04
RUN dpkg --add-architecture i386 && \
apt-get update
RUN apt-get update
RUN apt-get install -y \
alien \
@@ -10,23 +9,22 @@ RUN apt-get install -y \
cmake \
dos2unix \
flex \
g++-multilib \
gcc-multilib \
git \
libaio1:i386 \
libaio1 \
libboost-dev \
libboost-program-options-dev \
libcurl4-gnutls-dev:i386 \
libncurses5-dev:i386 \
libcurl4-gnutls-dev \
libncurses5-dev \
libsqlite3-dev \
libxml2-dev:i386 \
openjdk-11-jdk:i386 \
libxml2-dev \
openjdk-11-jdk \
psmisc \
supervisor \
wget \
vim \
nano \
tcpdump
tcpdump \
unzip
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*
@@ -34,44 +32,51 @@ RUN apt-get clean && \
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN wget https://github.com/SWG-Source/releases/releases/download/instantclients/oracle-instantclient18.3-basiclite-18.3.0.0.0-1.i386.rpm
RUN wget https://github.com/SWG-Source/releases/releases/download/instantclients/oracle-instantclient18.3-devel-18.3.0.0.0-1.i386.rpm
RUN wget https://github.com/SWG-Source/releases/releases/download/instantclients/oracle-instantclient18.3-sqlplus-18.3.0.0.0-1.i386.rpm
# === START: Oracle Client Local Copy ===
# Copy the Oracle Instant Client zip files from the local /downloads folder.
# Ensure you have downloaded these files manually and placed them in the same
# directory as this Dockerfile.
COPY downloads/instantclient-basic-linux-arm64.zip ./
COPY downloads/instantclient-sdk-linux-arm64.zip ./
COPY downloads/instantclient-sqlplus-linux-arm64.zip ./
# === END: Oracle Client Local Copy ===
RUN alien -i --target=amd64 oracle-instantclient18.3-basiclite-18.3.0.0.0-1.i386.rpm
RUN alien -i --target=amd64 oracle-instantclient18.3-devel-18.3.0.0.0-1.i386.rpm
RUN alien -i --target=amd64 oracle-instantclient18.3-sqlplus-18.3.0.0.0-1.i386.rpm
RUN rm -f oracle-instantclient18.3-*-18.3.0.0.0-1.i386.rpm
# Unzip the files, using the -o flag to overwrite duplicates without prompting
RUN unzip -o instantclient-basic-linux-arm64.zip -d /usr/local/ && \
unzip -o instantclient-sdk-linux-arm64.zip -d /usr/local/ && \
unzip -o instantclient-sqlplus-linux-arm64.zip -d /usr/local/
# Use a wildcard to find the created directory regardless of the exact version
RUN INSTANTCLIENT_DIR=$(find /usr/local/ -name 'instantclient_*' -type d) && mv "${INSTANTCLIENT_DIR}" /usr/local/instantclient
RUN ln -s /usr/local/instantclient/sqlplus /usr/bin/sqlplus
# Remove the zip files
RUN rm -f instantclient-basic-linux-arm64.zip \
instantclient-sdk-linux-arm64.zip \
instantclient-sqlplus-linux-arm64.zip
# === START: ORACLE CONFIGURATION FIX ===
# Create a directory for Oracle configuration files
RUN mkdir -p /etc/oracle
# Create sqlnet.ora to enable the EZCONNECT naming method
RUN echo 'NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)' > /etc/oracle/sqlnet.ora
# Tell the Oracle client where to find the configuration
ENV TNS_ADMIN=/etc/oracle
# === END: ORACLE CONFIGURATION FIX ===
ENV ORACLE_HOME=/usr/lib/oracle/18.3/client
ENV LD_LIBRARY_PATH=/usr/lib/oracle/18.3/client/lib:/usr/include/oracle/18.3/client
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-i386
# Update environment variables for the ARM64 paths
ENV ORACLE_HOME=/usr/local/instantclient
ENV LD_LIBRARY_PATH=/usr/local/instantclient
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64
# Declare build arguments with a default for the repo URL
ARG REPO_URL=https://github.com/SWG-Source/swg-main.git
ARG REPO_USERNAME
ARG REPO_PASSWORD
# Clone the repository, using credentials if provided
# This section for cloning the repository remains the same
RUN if [ -n "$REPO_USERNAME" ] && [ -n "$REPO_PASSWORD" ]; then \
# URL-encode the password to handle special characters
ENCODED_PASSWORD=$(echo "$REPO_PASSWORD" | sed -e 's/%/%25/g' -e 's/@/%40/g' -e 's/:/%3A/g' -e 's/\$/%24/g' -e 's/&/%26/g' -e 's/+/%2B/g' -e 's/,/%2C/g' -e 's|/|%2F|g' -e 's/;/%3B/g' -e 's/=/%3D/g' -e 's/?/%3F/g' -e 's/ /%20/g'); \
# Extract the hostname (e.g., gitlab.bmcstudios.org) from the repo URL
REPO_HOST=$(echo "$REPO_URL" | sed -e 's|https://||' -e 's|/.*||'); \
# Globally configure git to rewrite URLs for this host to include credentials.
# This ensures ALL git operations for this host are authenticated.
git config --global url."https://${REPO_USERNAME}:${ENCODED_PASSWORD}@${REPO_HOST}".insteadOf "https://${REPO_HOST}"; \
# Now clone the repository and its submodules. The rewrite rule will be applied automatically.
git clone --recurse-submodules "${REPO_URL}" /swg-main; \
else \
git clone --recurse-submodules "${REPO_URL}" /swg-main; \
@@ -83,12 +88,9 @@ RUN ant git_update_submods
RUN echo "db_service = FREEPDB1" > local.properties && \
echo "dbip = oracle" >> local.properties
# Copy the entrypoint script, convert its line endings, and make it executable
COPY entrypoint.sh /usr/local/bin/
RUN dos2unix /usr/local/bin/entrypoint.sh && chmod +x /usr/local/bin/entrypoint.sh
# Set the entrypoint
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# The original command now runs via the entrypoint script
CMD ["/usr/bin/supervisord", "-n"]

View File

@@ -3,7 +3,8 @@ services:
oracle:
container_name: oracle
hostname: oracle
image: gvenzl/oracle-free:latest
image: container-registry.oracle.com/database/free:latest
platform: linux/arm64
ports:
- "1521:1521"
environment:
@@ -11,11 +12,12 @@ services:
APP_USER: ${DB_USER:-swg}
APP_USER_PASSWORD: ${DB_USER_PASSWORD:-swg}
healthcheck:
test: ["CMD", "healthcheck.sh"]
# Updated healthcheck to use sqlplus, which exists in this image
test: ["CMD-SHELL", "sqlplus -S / as sysdba <<< \"select status from v\\$$instance;\" | grep -q \"OPEN\""]
interval: 10s
timeout: 5s
timeout: 30s
retries: 10
start_period: 5s
start_period: 300s
start_interval: 5s
volumes:
- oradata:/opt/oracle/oradata

Binary file not shown.

Binary file not shown.

Binary file not shown.