Imported from logic3579/dockerfiles (
AGENTS.md). Install upstream withnpx skills add logic3579/dockerfiles. Copyright stays with the author.
AGENTS.md
@/Users/logic/.codex/RTK.md
Project Notes
- This repository maintains Dockerfiles for utility and networking images.
- Prefer stable, lightweight base images for debug containers.
- Use Alpine stable tags for compact debug images when package coverage is sufficient.
- For upstream GHCR wrapper images, pin explicit stable package tags instead of floating
latest. xray-coretracksghcr.io/xtls/xray-core; the stable package tag omits the release-namevprefix (e.g. releasev26.3.27maps to image tag26.3.27).sing-boxtracksghcr.io/sagernet/sing-box; the stable package tag keeps thevprefix (e.g.v1.13.12).- Do not include unrelated generated files or local secrets in commits.
Container Runtimes
Makefile,build-all.sh, andrun.shdetect runtimes in order: docker → podman → Applecontainer(macOS,/usr/local/bin/container).- Apple
containerdiffers from docker/podman in CLI shape; the scripts dispatch by runtime name:- Image ops are nested: use
image push/image tag/image rm(no top-level aliases likermi). - No
--forceflag onimage prune/image rm. - No
--rm/--force-rmflags onbuild. builddefaults Dockerfile path to PWD (not the context dir), so the Makefile passes explicit-f ./$(DIR)/Dockerfile.- Cannot allocate a pty when stdin isn't a terminal (e.g. under
make);run.shstrips-it/-i/-tfrom the extracted command when this runtime is active.
- Image ops are nested: use
RUN_ARCH=amd64 make run DIR=...overrides the architecture on Applecontainer(which otherwise defaults to host arch). Use it when a published image isn't multi-arch yet.
Dockerfile Header Convention
- Each Dockerfile starts with a
# docker run ...example block. The block must end with a lone#line. run.shextracts the block viased -n '/docker run/,/^#$/p'; without the terminator the range matches through end-of-file and the eval'd command becomes garbage.
Makefile Targets
make image DIR=<dir>builds a single image tagged$(REGISTRY)/$(PROJECT)/<dir>:<short_sha>.make cleanalways prunes;make clean DIR=<dir>additionally removes the SHA-tagged image.make run DIR=<dir>extracts and runs the Dockerfile header's example viarun.sh.make infoprintsREGISTRY/PROJECT/ detectedCONTAINER_RUNTIME.- Default goal is
help.
CI
.github/workflows/docker-images.ymlbuilds and pushes to ACR, DockerHub, and ghcr.io.- Multi-arch:
linux/amd64,linux/arm64by default (viasetup-qemu-action+build-push-actionplatforms:). Per-directory overrides live in theDetermine build platformsstep — e.g.tcpingis amd64-only because its upstream base image (pouriyajamshidi/tcping) isn't published multi-arch. - Tags pushed per image:
:<short_sha>and:latest. - Pull requests build but do not push.