Skip to content

Instantly share code, notes, and snippets.

@Couto
Last active October 26, 2021 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Couto/1fbc9a743afc735dd21edb3ae6aa710d to your computer and use it in GitHub Desktop.
Save Couto/1fbc9a743afc735dd21edb3ae6aa710d to your computer and use it in GitHub Desktop.
Install SphereServer X using docker
FROM debian:buster-slim
WORKDIR /sphere
RUN apt-get update --fix-missing \
&& apt-get install -y \
curl \
mysql-common \
&& apt-get clean;
# libmysql Dependency
RUN curl -L -o libmysqlclient.deb http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.7/libmysqlclient20_5.7.31-0ubuntu0.18.04.1_amd64.deb
RUN echo 'a457f514e80ab609b3aee4dc7c6e7a0e59f29d9d4282f2d6f5ce47c49c2895fb libmysqlclient.deb' | sha256sum --check --status \
&& dpkg -i libmysqlclient.deb \
&& rm -rf libmysqlclient.deb \
&& rm -rf libmysqlclient.deb.sha256
# Install Sphere
RUN curl -L -o SphereSvrX-linux64-nightly.tar.gz https://forum.spherecommunity.net/sshare.php?downproj=64 \
&& tar -xzf SphereSvrX-linux64-nightly.tar.gz \
&& rm -rf SphereSvrX-linux64-nightly.tar.gz
RUN mv /sphere/build-64/bin64/* /sphere \
&& rm -rf /sphere/build-64
# Agree with nightly build
RUN sed -i 's/\[SPHERE\]/[SPHERE]\nAGREE=1/' sphere.ini
# Clean up
RUN apt-get remove --purge -y curl;
RUN apt-get autoremove -y
@gideonstar-git
Copy link

I have an almost identical Dockerfile. When I start the server manually, it also runs. But when I create an ENTRYPOINT, then I get an "Aborted (core dumped)". Have you possibly found a solution for this?

Greetings

@gideonstar-git
Copy link

Here is my Dockerfile:

FROM debian:stable
MAINTAINER Stefan Ritter

# Install needed packages
RUN apt update
RUN apt install -y wget mysql-common

# Create directories
RUN mkdir /sphereserver

# Binary is linked to libmysqlclient.so.20
RUN wget http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.7/libmysqlclient20_5.7.35-0ubuntu0.18.04.1_amd64.deb
RUN dpkg -i libmysqlclient20_5.7.35-0ubuntu0.18.04.1_amd64.deb

# Get sphere
RUN wget https://forum.spherecommunity.net/sshare.php?downproj=64 -O sphereserver.tar.gz
RUN tar xf sphereserver.tar.gz -C /sphereserver
RUN cp /sphereserver/build-64/bin64/SphereSvrX64_nightly /sphereserver/spheresvr

# Cleanup
RUN rm sphereserver.tar.gz libmysqlclient20_5.7.35-0ubuntu0.18.04.1_amd64.deb

# Run
WORKDIR "/sphereserver"
ENTRYPOINT ["/sphereserver/spheresvr"]

@Couto
Copy link
Author

Couto commented Oct 25, 2021

@gideonstar-git
This image for SphereServerX was an experiment that I did at the time:

I used to use the 0.56b version
The docker for that server was here: https://gitlab.com/infernalholm/sphere-scriptpack/-/blob/master/Dockerfile
and the base image was here: https://gitlab.com/infernalholm/sphere-dockerimage/-/blob/master/Dockerfile

The process was split into two steps: Build a docker image with the sphereserver (there was no point in having a entrypoint as it would never be able to run without the required files)

then build a image specific for my shard (so copying the multi, scripts, save folders...)
it did a bit more than that but you can use it as reference.

@gideonstar-git
Copy link

I just solved it by adding "tty: true" and "stdin_open: true" to my docker-compose.yml. "spheresvr" seems to need a tty, so that's the solution. In the end I came up with this working version:

https://github.com/gideonstar-git/docker-sphere-server-x

@Couto
Copy link
Author

Couto commented Oct 26, 2021

Ohh... That makes perfect sense! Totally forgot that spheresrv expects user inputs after boot. Which made take a look at the Helm chart I was using at the time and the tty flag is indeed enabled for that container!

https://gitlab.com/infernalholm/sphere-scriptpack/-/blob/master/chart/templates/deployment.yaml#L29-30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment