ngbs 5 yıl önce
ebeveyn
işleme
39457065c7
3 değiştirilmiş dosya ile 46 ekleme ve 0 silme
  1. 1 0
      .gitignore
  2. 27 0
      traefik/Dockerfile
  3. 18 0
      traefik/entrypoint.sh

+ 1 - 0
.gitignore

@@ -8,5 +8,6 @@
 *.log
 *.md
 !builder.sh
+!entrypoint.sh
 !README*.md
 unbound

+ 27 - 0
traefik/Dockerfile

@@ -0,0 +1,27 @@
+FROM playn/alpine:latest
+ARG version=2.2.4
+RUN apk --no-cache add ca-certificates
+RUN set -ex; \
+	apkArch="$(apk --print-arch)"; \
+	case "$apkArch" in \
+		armhf) arch='armv6' ;; \
+		aarch64) arch='arm64' ;; \
+		x86_64) arch='amd64' ;; \
+		*) echo >&2 "error: unsupported architecture: $apkArch"; exit 1 ;; \
+	esac; \
+	wget --quiet -O /tmp/traefik.tar.gz "https://github.com/containous/traefik/releases/download/v${version}/traefik_v${version}_linux_$arch.tar.gz"; \
+	tar xzvf /tmp/traefik.tar.gz -C /usr/local/bin traefik; \
+	rm -f /tmp/traefik.tar.gz; \
+	chmod +x /usr/local/bin/traefik
+COPY entrypoint.sh /
+EXPOSE 80
+ENTRYPOINT ["/entrypoint.sh"]
+CMD ["traefik"]
+
+# Metadata
+LABEL org.opencontainers.image.vendor="Containous" \
+	org.opencontainers.image.url="https://traefik.io" \
+	org.opencontainers.image.title="Traefik" \
+	org.opencontainers.image.description="A modern reverse-proxy" \
+	org.opencontainers.image.version="v${version}" \
+	org.opencontainers.image.documentation="https://docs.traefik.io"

+ 18 - 0
traefik/entrypoint.sh

@@ -0,0 +1,18 @@
+#!/bin/sh
+set -e
+
+# first arg is `-f` or `--some-option`
+if [ "${1#-}" != "$1" ]; then
+    set -- traefik "$@"
+fi
+
+# if our command is a valid Traefik subcommand, let's invoke it through Traefik instead
+# (this allows for "docker run traefik version", etc)
+if traefik "$1" --help >/dev/null 2>&1
+then
+    set -- traefik "$@"
+else
+    echo "= '$1' is not a Traefik command: assuming shell execution." 1>&2
+fi
+
+exec "$@"