mirror of
https://gitlab.bmcstudios.org/public_projects/swg-server-docker.git
synced 2026-01-16 17:04:26 -05:00
Fixes for oracle missing drivers
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -32,12 +32,9 @@ RUN apt-get clean && \
|
||||
RUN mkdir -p /var/log/supervisor
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
# === START: Oracle Client Local Copy ===
|
||||
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 ===
|
||||
|
||||
|
||||
# Unzip the files, using the -o flag to overwrite duplicates without prompting
|
||||
RUN unzip -o instantclient-basic-linux-arm64.zip -d /usr/local/ && \
|
||||
@@ -56,15 +53,17 @@ RUN rm -f instantclient-basic-linux-arm64.zip \
|
||||
instantclient-sdk-linux-arm64.zip \
|
||||
instantclient-sqlplus-linux-arm64.zip
|
||||
|
||||
# === START: ORACLE CONFIGURATION FIX ===
|
||||
# Organize the Oracle libraries into a standard 'lib' directory so cmake can find them.
|
||||
RUN mkdir /usr/local/instantclient/lib
|
||||
RUN mv /usr/local/instantclient/*.so* /usr/local/instantclient/lib/
|
||||
|
||||
RUN mkdir -p /etc/oracle
|
||||
RUN echo 'NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)' > /etc/oracle/sqlnet.ora
|
||||
ENV TNS_ADMIN=/etc/oracle
|
||||
# === END: ORACLE CONFIGURATION FIX ===
|
||||
|
||||
# Update environment variables for the ARM64 paths
|
||||
ENV ORACLE_HOME=/usr/local/instantclient
|
||||
ENV LD_LIBRARY_PATH=/usr/local/instantclient
|
||||
ENV LD_LIBRARY_PATH=/usr/local/instantclient/lib
|
||||
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64
|
||||
|
||||
# Declare build arguments with a default for the repo URL
|
||||
@@ -83,6 +82,10 @@ RUN if [ -n "$REPO_USERNAME" ] && [ -n "$REPO_PASSWORD" ]; then \
|
||||
fi
|
||||
|
||||
WORKDIR /swg-main
|
||||
|
||||
# Automatically replace the i386 Java paths with the correct arm64 paths.
|
||||
RUN sed -i 's/java-11-openjdk-i386/java-11-openjdk-arm64/g' /swg-main/build.xml
|
||||
|
||||
RUN ant git_update_submods
|
||||
|
||||
RUN echo "db_service = FREEPDB1" > local.properties && \
|
||||
|
||||
54
README.md
54
README.md
@@ -5,32 +5,16 @@ This project sets up a development environment for SWG using Docker.
|
||||
## Instructions:
|
||||
|
||||
1. Clone this repository.
|
||||
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.
|
||||
2. **(Optional)** To use a custom git repository or database credentials, create a file named `.env` in this directory. See the "Custom Configuration" section below for details.
|
||||
3. Run `docker compose up -d --build` to build the images and start the services. This may take a long time on the first run.
|
||||
4. Run `docker exec -it swg bash` to get a shell inside the `swg` container.
|
||||
5. Run `ant swg` to compile the game and assets. This is a one-time step that can take over an hour. You only need to re-run it if you destroy the Docker volumes.
|
||||
6. Run `ant start &` to start the server.
|
||||
7. Run `ant stop` to stop the 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:
|
||||
## Connecting Your Client
|
||||
|
||||
```build.xml
|
||||
<target name="set_ubuntu_cfg" if="is_ubuntu18">
|
||||
<replace dir="${exe}">
|
||||
<include name="**/*.cfg"/>
|
||||
<replacefilter token="environmentVariable=PATH+=/usr/java/bin:./" value="environmentVariable=PATH+=/usr/lib/jvm/java-11-openjdk-arm64/bin:./"/>
|
||||
<replacefilter token="environmentVariable=LD_LIBRARY_PATH+=/usr/java/lib:/usr/java/lib/server:./" value="environmentVariable=LD_LIBRARY_PATH+=/usr/lib/jvm/java-11-openjdk-arm64/lib:/usr/lib/jvm/java-11-openjdk-arm64/lib/server:./"/>
|
||||
</replace>
|
||||
</target>
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
To connect your client to the server, you'll need to open the `login.cfg` file within your client directory
|
||||
and set the `loginServerAddress0` to the ip address of the machine that is hosting the docker container, or
|
||||
to `127.0.0.1` if you are hosting the docker container on the same machine as the client.
|
||||
To connect your client, open the `login.cfg` file in your client directory and ensure the settings match the following. The server address should be `127.0.0.1` if the client is on the same machine as the Docker container.
|
||||
|
||||
```login.cfg
|
||||
[Station]
|
||||
@@ -42,27 +26,7 @@ to `127.0.0.1` if you are hosting the docker container on the same machine as th
|
||||
loginServerAddress0=127.0.0.1
|
||||
```
|
||||
|
||||
**NOTE:** If your client does not connect, i.e., you're able to login but you can't connect to the galaxy, it's likely that you
|
||||
need to update the CLUSTER_LIST with the correct IP ADDRESS to match where the docker container is being hosted. By default
|
||||
this gets set to `127.0.0.1` in the `entrypoint.sh` script. If you're hosting docker remotely, then you need to update the
|
||||
`entrypoint.sh` script, at the bottom and set the CLUSTER_LIST IP to your remote IP. Then just do a `docker compose down` and
|
||||
a `docker compose up -d --build` and everything will be fixed.
|
||||
|
||||
#### Completely wiping your local Docker environment
|
||||
|
||||
> docker compose down -v
|
||||
|
||||
This will remove all the volumes, including the database and the swg-main project directory. You will have to recompile the
|
||||
project all over again.
|
||||
|
||||
#### Shutting down your Container, Safely, Without Loss
|
||||
|
||||
> docker compose down
|
||||
|
||||
This will shut down the container, but it will keep the volumes, i.e., your database will stay, and your swg-main project
|
||||
directory will be kept intact.
|
||||
|
||||
## Custom Repository
|
||||
## Custom SWG Repository
|
||||
|
||||
You can configure the Docker build to pull the `swg-main` source from your own repository. Create a file named `.env` in the root of this project and add the following variables as needed.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user