Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[no refs]: containerized mcrcon #70

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

motoreagattoimburrato
Copy link

Hi,

as you can see, I realized an docker environments for mcrcon application, I hope that it is helpful.

Regards,
Luke

@nywek
Copy link

nywek commented Feb 28, 2021

What is the size of the final image? I believe FROM gcc could bloat it quite a bit.
Maybe use gcc to build the executable and another image (like busybox:glibc ?) to run it.

@motoreagattoimburrato
Copy link
Author

motoreagattoimburrato commented Mar 1, 2021

Hi @Fear837

the size of the final image is:
tiiffi/mcrcon latest 1e334f7fcc6f 13 hours ago 1.19GB

I used gcc, instead busybox or alpine, for convenience: at the moment an image like this is useless if is used in an orchestration system and the only way to use that makes sense (obv: my opinion) is locally on own workstation.
But I agree that 1.2GB is too much, I'll try with alpine, thanks.

@motoreagattoimburrato
Copy link
Author

Update
With alpine:3 the size is more contained:
tiiffi/mcrcon latest 164139f797ad 4 seconds ago 202MB
I'll commit this change

@tboerger
Copy link

I would suggest this Dockerfile instead, it results in 7MB size:

FROM alpine:edge AS build

RUN apk add --no-cache build-base musl-dev
ADD . /tmp/
RUN cd /tmp && make && make install

FROM alpine:edge

ENTRYPOINT ["/usr/local/bin/mcrcon"]
COPY --from=build /usr/local/bin/mcrcon /usr/local/bin/mcrcon

@tboerger
Copy link

If somebody is able to statically compile the binary you could even use a scratch or busybox image as a base which would reduce the size and potential security issues even more.

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

Successfully merging this pull request may close these issues.

4 participants