Skip to content

Commit

Permalink
feat: use dumb-init
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-2369 committed Nov 22, 2024
1 parent f808d66 commit df43586
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 23 deletions.
5 changes: 3 additions & 2 deletions debian11-python-shadowsocksr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM debian:bullseye-20241111-slim
LABEL authors="eric2369"

RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates git openssh-client python3 \
&& apt-get install -y --no-install-recommends dumb-init curl ca-certificates git openssh-client python3 \
&& rm -rf /var/lib/apt/lists/*

RUN useradd --create-home --shell /bin/bash shadowsocksr
Expand Down Expand Up @@ -45,4 +45,5 @@ ENV OBFS_PARAM=""
ENV DNS_IPV6="false"
ENV TZ="Asia/Shanghai"

CMD ["/home/shadowsocksr/shadowsocksr/shadowsocks/start.sh"]
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["bash", "-c", "/home/shadowsocksr/shadowsocksr/shadowsocks/start.sh"]
11 changes: 6 additions & 5 deletions debian12-codeserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM debian:bookworm-20241111-slim
LABEL authors="eric2369"

RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates git openssh-client dumb-init sudo wget vim zip unzip htop procps \
&& apt-get install -y --no-install-recommends dumb-init curl ca-certificates git openssh-client sudo wget vim zip unzip htop procps \
&& rm -rf /var/lib/apt/lists/*

RUN useradd --create-home --shell /bin/bash eric2369 \
Expand All @@ -12,10 +12,10 @@ ARG TARGETPLATFORM
RUN set -eux; \
case "${TARGETPLATFORM}" in \
"linux/amd64") \
URL="https://github.com/coder/code-server/releases/download/v4.95.2/code-server_4.95.2_amd64.deb"; \
URL="https://github.com/coder/code-server/releases/download/v4.95.3/code-server_4.95.3_amd64.deb"; \
;; \
"linux/arm64") \
URL="https://github.com/coder/code-server/releases/download/v4.95.2/code-server_4.95.2_arm64.deb"; \
URL="https://github.com/coder/code-server/releases/download/v4.95.3/code-server_4.95.3_arm64.deb"; \
;; \
*) \
echo "Unsupported platform: ${TARGETPLATFORM}"; \
Expand Down Expand Up @@ -50,11 +50,12 @@ RUN curl "https://sh.rustup.rs" --location --output - | bash -s -- -y --default-

RUN echo "#!/bin/sh" > /home/eric2369/start.sh \
&& echo "set -eu" >> /home/eric2369/start.sh \
&& echo "exec dumb-init /usr/bin/code-server --bind-addr 0.0.0.0:8080 --auth password --disable-telemetry --disable-update-check /home/eric2369/project" >> /home/eric2369/start.sh \
&& echo "exec /usr/bin/code-server --bind-addr 0.0.0.0:8080 --auth password --disable-telemetry --disable-update-check /home/eric2369/project" >> /home/eric2369/start.sh \
&& chmod +x /home/eric2369/start.sh

ENV PASSWORD="Eric2369"

Check warning on line 56 in debian12-codeserver/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
VOLUME /home/eric2369/project
EXPOSE 8080

CMD ["/home/eric2369/start.sh"]
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["bash", "-c", "/home/eric2369/start.sh"]
7 changes: 4 additions & 3 deletions debian12-nodejs-typescript-salesforcecli-chromium/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM debian:bookworm-20241111-slim
LABEL authors="eric2369"

RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates git openssh-client xz-utils \
&& apt-get install -y --no-install-recommends dumb-init curl ca-certificates git openssh-client xz-utils \
&& rm -rf /var/lib/apt/lists/*

ARG TARGETPLATFORM
Expand All @@ -21,16 +21,17 @@ RUN set -eux; \
esac; \
curl "${URL}" --location | tar --extract --xz --directory=/usr/local --strip-components=1

RUN npm install [email protected] [email protected] @salesforce/cli@2.66.7 -g \
RUN npm install [email protected] [email protected] @salesforce/cli@2.67.7 -g \
&& npm cache clean --force

RUN mkdir -p /root/.config/sf \
&& echo '["sfdx-git-delta"]' > /root/.config/sf/unsignedPluginAllowList.json \
&& sf plugins install [email protected].3 \
&& sf plugins install [email protected].4 \
&& npm cache clean --force

RUN apt-get update \
&& apt-get install -y --no-install-recommends chromium \
&& rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/bin/bash"]
7 changes: 4 additions & 3 deletions debian12-nodejs-typescript-salesforcecli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM debian:bookworm-20241111-slim
LABEL authors="eric2369"

RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates git openssh-client xz-utils \
&& apt-get install -y --no-install-recommends dumb-init curl ca-certificates git openssh-client xz-utils \
&& rm -rf /var/lib/apt/lists/*

ARG TARGETPLATFORM
Expand All @@ -21,12 +21,13 @@ RUN set -eux; \
esac; \
curl "${URL}" --location | tar --extract --xz --directory=/usr/local --strip-components=1

RUN npm install [email protected] [email protected] @salesforce/cli@2.66.7 -g \
RUN npm install [email protected] [email protected] @salesforce/cli@2.67.7 -g \
&& npm cache clean --force

RUN mkdir -p /root/.config/sf \
&& echo '["sfdx-git-delta"]' > /root/.config/sf/unsignedPluginAllowList.json \
&& sf plugins install [email protected].3 \
&& sf plugins install [email protected].4 \
&& npm cache clean --force

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/bin/bash"]
5 changes: 3 additions & 2 deletions debian12-serverstatusrust-client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM debian:bookworm-20241111-slim
LABEL authors="eric2369"

RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates unzip procps iproute2 \
&& apt-get install -y --no-install-recommends dumb-init curl ca-certificates unzip procps iproute2 \
&& rm -rf /var/lib/apt/lists/*

RUN useradd --create-home --shell /bin/bash serverstatus
Expand Down Expand Up @@ -35,4 +35,5 @@ ENV ADDR=""
ENV USER=""
ENV PASS=""

CMD ["/home/serverstatus/start.sh"]
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["bash", "-c", "/home/serverstatus/start.sh"]
5 changes: 3 additions & 2 deletions debian12-serverstatusrust-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM debian:bookworm-20241111-slim
LABEL authors="eric2369"

RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates unzip procps iproute2 \
&& apt-get install -y --no-install-recommends dumb-init curl ca-certificates unzip procps iproute2 \
&& rm -rf /var/lib/apt/lists/*

RUN useradd --create-home --shell /bin/bash serverstatus
Expand Down Expand Up @@ -36,4 +36,5 @@ RUN mkdir --parents /home/serverstatus/config \
VOLUME /home/serverstatus/config
EXPOSE 8080

CMD ["/home/serverstatus/start.sh"]
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["bash", "-c", "/home/serverstatus/start.sh"]
4 changes: 1 addition & 3 deletions portainer-server/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: "3.9"

services:
traefik:
image: "traefik:3.2.0"
image: "traefik:3.2.1"
container_name: "traefik-container"
command:
- "--entryPoints.web.address=:80"
Expand Down
4 changes: 1 addition & 3 deletions traefik/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: "3.9"

services:
traefik:
image: "traefik:3.2.0"
image: "traefik:3.2.1"
container_name: "traefik-container"
command:
- "--entryPoints.web.address=:80"
Expand Down

0 comments on commit df43586

Please sign in to comment.