Pugmatt / BedrockConnect

Join any Minecraft Bedrock Edition server IP on Xbox One, Nintendo Switch, and PS4/PS5
GNU General Public License v3.0
1.46k stars 163 forks source link

Docker Image Build/Publish Automation #274

Open ashanrath opened 2 years ago

ashanrath commented 2 years ago

Is your feature request related to a problem? Please describe. Currently need to perform the docker image build locally. This can be time consuming on low power devices such as RPi.

Describe the solution you'd like Configure docker auto-builds within the git project.

Describe alternatives you've considered N/A

Additional context Possibly consider publishing the image to github as an automated workflow.

ashanrath commented 2 years ago

@Pugmatt @AndrewLugg @MarcProe @SeniorHeld, tagging you as previous commits to the dockerfiles. I was considering replacing the two Dockerfile instances (standard and RPi) with a single file as a stepping stone for simplifying build automation.

At the moment the only real differences are:

Was there a specific reason to use an older JDK for the RPi and less memory for the standard, or have they just fallen out of sync as they've been updated individually?

AndrewLugg commented 2 years ago

I have previously found that the openjdk:11 only has ARM64. The default RaspberryPi OS is still 32 bit, so needs ARM32 image. They do offer a 64 bit OS for RPi, but it isn't the default. There may be images of openJDK:11 with ARM32 as well, but I didn't find it when I was tweaking the images.

Although looking at it now, this commit has broken it for 32bit RPi https://github.com/Pugmatt/BedrockConnect/commit/cda9281d6a12c43e764b1820e41e0cc7f65c81a5 as the default openJDK doesn't have any 32 bit images. The main docker image has only 64 bit. You could merge the 64 bit RPi and Standard, and have a seperate one for 32bit RPi, unless there is a image that has all architecture. (this image has one for all arch's https://hub.docker.com/r/adoptopenjdk/openjdk11/, but I haven't tested it)

As for the memory level, I don't know why it was set to 1GB over 256MB.

hTobi02 commented 2 years ago

Hello, First: with the following Dockerfile you should be able to run Bedrock-Connect also from an ARM32 machine:

FROM adoptopenjdk/openjdk11:ubuntu-jre
RUN mkdir -p /docker/brc
ADD https://github.com/Pugmatt/BedrockConnect/releases/latest/download/BedrockConnect-1.0-SNAPSHOT.jar /docker/brc
WORKDIR /docker/brc
EXPOSE 19132/udp
CMD ["java", "-Xms256M", "-Xmx256M", "-jar", "BedrockConnect-1.0-SNAPSHOT.jar", "nodb=true"]

It is also extremely small (88-98MB), as you can see here (Docker Hub).

Second: I absolutely don't know, why one Dockerfile has 1GB and the other one has only 256MB. But 256MB should be plenty to run Bedrock-Connect.

ashanrath commented 2 years ago

Hello, First: with the following Dockerfile you should be able to run Bedrock-Connect also from an ARM32 machine:

FROM adoptopenjdk/openjdk11:ubuntu-jre
RUN mkdir -p /docker/brc
ADD https://github.com/Pugmatt/BedrockConnect/releases/latest/download/BedrockConnect-1.0-SNAPSHOT.jar /docker/brc
WORKDIR /docker/brc
EXPOSE 19132/udp
CMD ["java", "-Xms256M", "-Xmx256M", "-jar", "BedrockConnect-1.0-SNAPSHOT.jar", "nodb=true"]

It is also extremely small (88-98MB), as you can see here (Docker Hub).

Second: I absolutely don't know, why one Dockerfile has 1GB and the other one has only 256MB. But 256MB should be plenty to run Bedrock-Connect.

That's great, thanks for sharing. I'll test out a unified file on a few devices then add it to a PR next week.

MarcProe commented 2 years ago

@Pugmatt @AndrewLugg @MarcProe @SeniorHeld, tagging you as previous commits to the dockerfiles. I was considering replacing the two Dockerfile instances (standard and RPi) with a single file as a stepping stone for simplifying build automation.

No specific reason for the 1G or the v8 in the initial commit as far as I recall. It just worked at the time.