This documents how to do live development on the smart_proxy_container_gateway
plugin against a foremanctl-deployed foreman-proxy container.
A systemd drop-in config volume-mounts your local git checkout of the plugin's
lib/ directory over the RPM-installed gem inside the container. Edits to local
files take effect on the next container restart — no image rebuild needed.
- A foremanctl deployment with
container-gatewayenabled - A git clone of
smart_proxy_container_gatewayon the host
git clone https://github.com/theforeman/smart_proxy_container_gateway.git /root/smart_proxy_container_gateway
cd /root/smart_proxy_container_gateway
git checkout my-feature-branch # optional: switch to your branchThe drop-in mounts the local lib/ over the installed gem's lib/ inside the
container. Adjust the gem version in the target path if the installed version
differs from 4.0.1.
cat > /etc/containers/systemd/foreman-proxy.container.d/dev-container-gateway.conf <<'EOF'
[Container]
Volume=/root/smart_proxy_container_gateway/lib:/usr/share/gems/gems/smart_proxy_container_gateway-4.0.1/lib:Z
EOFTo find the exact installed gem version:
podman exec foreman-proxy gem list smart_proxy_container_gatewaysystemctl daemon-reload
systemctl restart foreman-proxy.service# Confirm mount is active
podman inspect foreman-proxy --format '{{range .Mounts}}{{.Source}} -> {{.Destination}}{{"\n"}}{{end}}' | grep container_gateway
# Confirm container is running
podman ps --filter name=foreman-proxy
# Check proxy features are loaded
curl -sk https://localhost:9090/features | python3 -m json.tooledit code locally → systemctl restart foreman-proxy → test → repeat
- Edit files under
/root/smart_proxy_container_gateway/lib/ - Restart the container:
systemctl restart foreman-proxy.service - Check logs:
podman logs -f foreman-proxy - Test your changes
cd /root/smart_proxy_container_gateway
git checkout other-branch
systemctl restart foreman-proxy.serviceNo drop-in changes needed — the mount points at the same directory regardless of which branch is checked out.
Remove the drop-in and restart to go back to the RPM-installed gem:
rm /etc/containers/systemd/foreman-proxy.container.d/dev-container-gateway.conf
systemctl daemon-reload
systemctl restart foreman-proxy.service- Only the
lib/directory is mounted. If your changes add new gem dependencies, you need to rebuild the image instead. - The
:Zsuffix on the volume handles SELinux relabeling. - The gem version in the target path (
4.0.1) must match what's installed in the image. If you update the base image, check and update the drop-in.