From 2b520ccf1c17261303db8d6ddcc2b9332bc53515 Mon Sep 17 00:00:00 2001 From: "Calabro, Brandon" Date: Fri, 10 Oct 2025 13:45:19 -0500 Subject: [PATCH] Fixes for ARM after container is up --- Dockerfile | 6 +++--- README.md | 20 +++++++++++++++++--- docker-compose.yaml | 12 +++++++----- entrypoint.sh | 32 +++++++++++++++++++++----------- 4 files changed, 48 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9b49c48..e768f55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,9 +33,6 @@ RUN mkdir -p /var/log/supervisor COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf # === 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 ./ @@ -51,6 +48,9 @@ RUN unzip -o instantclient-basic-linux-arm64.zip -d /usr/local/ && \ 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 +# Make the Oracle JDBC driver available to Ant +RUN cp /usr/local/instantclient/ojdbc8.jar /usr/share/ant/lib/ + # Remove the zip files RUN rm -f instantclient-basic-linux-arm64.zip \ instantclient-sdk-linux-arm64.zip \ diff --git a/README.md b/README.md index 5792dec..a4845d1 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,23 @@ This project sets up a development environment for SWG using Docker. 2. **(Optional)** To use a custom git repository for the server source, create a file named `.env` in this directory. See the "Custom Repository" section below for details. 3. Run `docker compose up -d --build` to build the images and start the services. 4. Run `docker exec -it swg bash` to log into a shell in the `swg` container. -5. Run `ant swg` to compile the game and the assets. You only need to run this once, the first time you build the docker image, or if you destroy the docker volumes. -6. Run `ant start &` to run the server. -7. Run `ant stop` to stop your server. + +5. Update the `build.xml` file and fix the task for `set_ubuntu_cfg` so that it pulls the `ARM64` drivers rather than the `Intel` drivers. + Below is the correct configuration: + + ```build.xml + + + + + + + + ``` + +6. Run `ant swg` to compile the game and the assets. You only need to run this once, the first time you build the docker image, or if you destroy the docker volumes. +7. Run `ant start &` to run the server. +8. Run `ant stop` to stop your server. ## Connecting your client diff --git a/docker-compose.yaml b/docker-compose.yaml index 99dc93f..0b0d1b7 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,11 +8,12 @@ services: ports: - "1521:1521" environment: - ORACLE_PASSWORD: swg + # Use the new complex password for SYS/SYSTEM users + ORACLE_PASSWORD: ${DB_USER_PASSWORD} APP_USER: ${DB_USER:-swg} - APP_USER_PASSWORD: ${DB_USER_PASSWORD:-swg} + # Use the new complex password for the 'swg' user + APP_USER_PASSWORD: ${DB_USER_PASSWORD} healthcheck: - # 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: 30s @@ -43,8 +44,9 @@ services: DB_HOST: oracle DB_PORT: 1521 DB_USER: ${DB_USER:-swg} - ORACLE_PASSWORD: swg - DB_PASSWORD: ${DB_USER_PASSWORD:-swg} + ORACLE_PASSWORD: ${DB_USER_PASSWORD} + # Use the new complex password here as well + DB_PASSWORD: ${DB_USER_PASSWORD} tty: true stdin_open: true volumes: diff --git a/entrypoint.sh b/entrypoint.sh index 0a3a3e7..bec0903 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,15 @@ #!/bin/sh # entrypoint.sh +# Create a build.properties file to pass Docker env vars to the Ant build +cat < /swg-main/build.properties +# This file is auto-generated by entrypoint.sh +db_username=${DB_USER} +db_password=${DB_PASSWORD} +dbip=${DB_HOST} +db_service=${DB_SERVICE_NAME:-FREEPDB1} +EOF + # Get the container's own IP address at runtime CONTAINER_IP=$(hostname -i) @@ -12,24 +21,24 @@ START_MARKER="# BEGIN DOCKER-MANAGED CONFIG" END_MARKER="# END DOCKER-MANAGED CONFIG" # 1. Remove the entire block from the start marker to the end marker. -# The -i flag modifies the file in-place. -# On the first run, this command will do nothing if the markers don't exist, which is fine. sed -i "/${START_MARKER}/,/${END_MARKER}/d" ${CONFIG_FILE} # 2. Now, append the new, updated configuration block, including the markers. cat <> ${CONFIG_FILE} ${START_MARKER} -# This block is automatically managed by the container's entrypoint script. +# This block is automatically managed by the container's entrypoint.sh script. # Do not edit it manually, as changes will be overwritten on container restart. [dbProcess] -DSN=//oracle/FREEPDB1 -databaseUID=DBUSERNAME +DSN=//${DB_HOST}/${DB_SERVICE_NAME:-FREEPDB1} +databaseUID=${DB_USER} +databasePWD=${DB_PASSWORD} centralServerAddress=${CONTAINER_IP} [LoginServer] -DSN=//oracle/FREEPDB1 -databaseUID=DBUSERNAME +DSN=//${DB_HOST}/${DB_SERVICE_NAME:-FREEPDB1} +databaseUID=${DB_USER} +databasePWD=${DB_PASSWORD} developmentMode=true useExternalAuth=false @@ -48,8 +57,8 @@ debugMode=1 [TaskManager] loginServerAddress=${CONTAINER_IP} node0=${CONTAINER_IP} -environmentVariable=PATH+=/usr/lib/jvm/java-11-openjdk-i386/bin:./ -environmentVariable=LD_LIBRARY_PATH+=/usr/lib/jvm/java-11-openjdk-i386/lib:/usr/lib/jvm/java-11-openjdk-i386/lib/server:./ +environmentVariable=PATH+=/usr/lib/jvm/java-11-openjdk-arm64/bin:./ +environmentVariable=LD_LIBRARY_PATH+=/usr/lib/jvm/java-11-openjdk-arm64/lib:/usr/lib/jvm/java-11-openjdk-arm64/lib/server:./ ${END_MARKER} EOF @@ -58,10 +67,11 @@ cd /swg-main ant update_configs # Update the cluster_list to use the local host IP address for connections. -/usr/lib/oracle/18.3/client/bin/sqlplus -S ${DB_USER}/${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/FREEPDB1 <