Skip to content

Reduce container size #352

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions cmglinux/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
FROM public.ecr.aws/docker/library/debian:bookworm-slim
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should keep the ecr.aws registry. Docker's pull limits are the reason

FROM debian:bookworm-slim AS builder

ARG DISK_SIZE=4G

RUN apt-get update -qy && \
apt-get install -y --no-install-recommends qemu-utils && \
rm -rf /var/lib/apt/lists/*

ARG IMAGE
COPY $IMAGE* /
RUN qemu-img resize /$IMAGE $DISK_SIZE

FROM debian:bookworm-slim
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment for the image registry as above


ARG DEBIAN_FRONTEND=noninteractive
ARG DISK_SIZE=4G

RUN apt-get update -qy \
&& apt-get install -y --no-install-recommends \
&& apt-get install -y --no-install-recommends\
bridge-utils \
iproute2 \
socat \
Expand All @@ -16,17 +28,14 @@ RUN apt-get update -qy \
iptables \
nftables \
telnet \
genisoimage \
python3-yaml \
cloud-utils \
sshpass \
&& rm -rf /var/lib/apt/lists/*

ARG IMAGE
COPY $IMAGE* /
COPY --from=builder $IMAGE* /
COPY *.py /

# RUN qemu-img resize /${IMAGE} ${DISK_SIZE}

EXPOSE 22 5000 10000-10099
HEALTHCHECK CMD ["/healthcheck.py"]
ENTRYPOINT ["/launch.py"]
21 changes: 14 additions & 7 deletions freebsd/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
FROM debian:bookworm-slim AS builder

ARG DISK_SIZE=4G

RUN apt-get update -qy && \
apt-get install -y --no-install-recommends qemu-utils && \
rm -rf /var/lib/apt/lists/*

ARG IMAGE
COPY $IMAGE* /
RUN qemu-img resize /$IMAGE $DISK_SIZE

FROM debian:bookworm-slim

ARG DEBIAN_FRONTEND=noninteractive
ARG DISK_SIZE=4G

RUN apt-get update -qy \
&& apt-get upgrade -qy \
&& apt-get install -y \
&& apt-get install -y --no-install-recommends\
bridge-utils \
iproute2 \
python3-ipy \
socat \
qemu-kvm \
tcpdump \
Expand All @@ -23,11 +33,8 @@ RUN apt-get update -qy \
&& rm -rf /var/lib/apt/lists/*

ARG IMAGE
COPY $IMAGE* /
COPY --from=builder $IMAGE* /
COPY *.py /
COPY --chmod=0755 backup.sh /
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to keep the backup file


RUN qemu-img resize /${IMAGE} ${DISK_SIZE}

EXPOSE 22 5000 10000-10099
HEALTHCHECK CMD ["/healthcheck.py"]
Expand Down
20 changes: 13 additions & 7 deletions openbsd/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
FROM debian:bookworm-slim
FROM debian:bookworm-slim AS builder

ARG DEBIAN_FRONTEND=noninteractive
ARG DISK_SIZE=4G
ARG IMAGE

RUN apt-get update -qy && \
apt-get install -y --no-install-recommends qemu-utils && \
rm -rf /var/lib/apt/lists/*

COPY $IMAGE* /
RUN qemu-img resize /${IMAGE} ${DISK_SIZE}

FROM debian:bookworm-slim

RUN apt-get update -qy \
&& apt-get upgrade -qy \
&& apt-get install -y \
&& apt-get install -y --no-install-recommends\
bridge-utils \
iproute2 \
python3-ipy \
Expand All @@ -23,12 +31,10 @@ RUN apt-get update -qy \
&& rm -rf /var/lib/apt/lists/*

ARG IMAGE
COPY $IMAGE* /
COPY --from=builder $IMAGE* /
COPY *.py /
COPY --chmod=0755 backup.sh /

RUN qemu-img resize /${IMAGE} ${DISK_SIZE}

EXPOSE 22 5000 10000-10099
HEALTHCHECK CMD ["/healthcheck.py"]
ENTRYPOINT ["/launch.py"]
18 changes: 14 additions & 4 deletions ubuntu/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
FROM debian:bookworm-slim AS builder

ARG DISK_SIZE=4G

RUN apt-get update -qy && \
apt-get install -y --no-install-recommends qemu-utils && \
rm -rf /var/lib/apt/lists/*

ARG IMAGE
COPY $IMAGE* /
RUN qemu-img resize /$IMAGE $DISK_SIZE

FROM debian:bookworm-slim

ARG DEBIAN_FRONTEND=noninteractive
ARG DISK_SIZE=4G

RUN apt-get update -qy \
&& apt-get install -y \
&& apt-get install -y --no-install-recommends\
bridge-utils \
iproute2 \
socat \
Expand All @@ -21,11 +33,9 @@ RUN apt-get update -qy \
&& rm -rf /var/lib/apt/lists/*

ARG IMAGE
COPY $IMAGE* /
COPY --from=builder $IMAGE* /
COPY *.py /

RUN qemu-img resize /${IMAGE} ${DISK_SIZE}

EXPOSE 22 5000 10000-10099
HEALTHCHECK CMD ["/healthcheck.py"]
ENTRYPOINT ["/launch.py"]