-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rename traefik-docker-proxy to docker-api-proxy
- Loading branch information
Showing
7 changed files
with
48 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,23 +9,23 @@ WORKDIR /build | |
|
||
RUN go install github.com/caddyserver/xcaddy/cmd/[email protected] | ||
|
||
RUN xcaddy build "v${CADDY_VERSION}" --output traefik-docker-proxy | ||
RUN xcaddy build "v${CADDY_VERSION}" --output docker-api-proxy | ||
|
||
# --- Final stage --- | ||
FROM cgr.dev/chainguard/wolfi-base:latest | ||
|
||
COPY --from=build --chown=0:0 --chmod=0755 \ | ||
/build/traefik-docker-proxy /usr/bin/traefik-docker-proxy | ||
/build/docker-api-proxy /usr/bin/docker-api-proxy | ||
|
||
COPY Caddyfile /etc/Caddyfile | ||
|
||
ENTRYPOINT [ "/usr/bin/traefik-docker-proxy" ] | ||
ENTRYPOINT [ "/usr/bin/docker-api-proxy" ] | ||
|
||
CMD [ "run", "--config", "/etc/Caddyfile" ] | ||
|
||
LABEL \ | ||
org.opencontainers.image.title="traefik-docker-proxy" \ | ||
org.opencontainers.image.title="docker-api-proxy" \ | ||
org.opencontainers.image.source="https://github.com/f-bn/containers-images/traefik" \ | ||
org.opencontainers.image.description="Custom Caddy image for limiting Traefik access to the Docker API through the socket" \ | ||
org.opencontainers.image.description="Custom Caddy image for limiting applications access to the Docker API through the socket" \ | ||
org.opencontainers.image.licenses="Apache-2.0" \ | ||
org.opencontainers.image.authors="Florian Bobin <[email protected]>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## General informations | ||
|
||
Custom Caddy image built from sources with specific configuration for proxying Docker socket to limit access of applications to Docker API. | ||
|
||
Built with Go 1.23.5 | ||
|
||
## Why creating this image ? | ||
|
||
The image goal is to provide the most simple solution for limiting applications access to the Docker API through the socket. | ||
|
||
This allows some application such as Traefik or Prometheus to access the Docker API without requiring to mount the Docker API socket inside the container (that could lead to a pretty bad privilege escalation if application is compromised). | ||
|
||
For a more flexible solution, prefer [docker-socket-proxy](https://github.com/Tecnativa/docker-socket-proxy) from Tecnativa. | ||
|
||
## Image configuration | ||
|
||
This image come with a specific Caddy configuration for the use-case described above. The reverse proxy server listens on `http://localhost:2375` and will forward request to the Docker UNIX domain socket mounted inside this proxy container. | ||
|
||
Only `GET` method on a specific set of Docker API endpoints are allowed: | ||
- `/info` | ||
- `/events` | ||
- `/networks` | ||
- `/containers/json` | ||
- `/containers/<container id>/json` | ||
- `/version` | ||
|
||
For any other methods and/or endpoints called, a 403 error is returned. Moreover, endpoints required for Docker Swarm are not considered. | ||
|
||
You can find a basic [docker-compose.yml](./examples/traefik.yml) in the `examples` folder showing a barebone configuration using this container image (i.e absolutely not production-ready). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.