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

images: Minimize container #388

Merged
merged 2 commits into from
Feb 20, 2021
Merged
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
24 changes: 18 additions & 6 deletions images/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
FROM fedora:latest
FROM fedora:latest AS builder
LABEL maintainer='[email protected]'

RUN dnf -y update && \
dnf -y install nginx openssh-server /usr/bin/python && \
dnf clean all && \
mkdir -p /home/user

# avoid unnecessary stuff in the container; systemd is a protected package, so apply some extra force
RUN source /etc/os-release && \
dnf install -y --releasever=$VERSION_ID --setopt=install_weak_deps=False --installroot=/build \
coreutils-single \
glibc-minimal-langpack \
nginx \
openssh-server \
tar \
/usr/bin/python3 && \
rpm --root=/build --verbose --erase --nodeps systemd && \
dnf remove -y --installroot=/build systemd-networkd device-mapper dbus-broker cryptsetup && \
rm -r /build/var/cache/dnf /build/var/lib/dnf /build/var/lib/rpm*

FROM scratch
COPY --from=builder /build /

RUN mkdir -p /home/user
# can't use ../sink/sink with docker build
ADD https://raw.githubusercontent.com/cockpit-project/cockpituous/master/sink/sink /home/user/sink

Expand Down
2 changes: 2 additions & 0 deletions tasks/run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ EOF
fi

# start podman and run RabbitMQ in the background
# HACK: put data into a tmpfs instead of anonymous volume, see https://github.com/containers/podman/issues/9432
podman run -d --name cockpituous-rabbitmq --pod=new:cockpituous \
--publish $IMAGE_PORT:8080 \
--tmpfs /var/lib/rabbitmq \
-v "$RABBITMQ_CONFIG":/etc/rabbitmq:ro \
-v "$SECRETS"/webhook:/run/secrets/webhook:ro \
docker.io/rabbitmq:3-management
Expand Down