mcrcon
mcrcon copied to clipboard
[no refs]: containerized mcrcon
Hi,
as you can see, I realized an docker environments for mcrcon application, I hope that it is helpful.
Regards, Luke
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.
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.
Update
With alpine:3
the size is more contained:
tiiffi/mcrcon latest 164139f797ad 4 seconds ago 202MB
I'll commit this change
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
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.