From 90916b1b302fd39cd3c42b54078de6a9ba440830 Mon Sep 17 00:00:00 2001 From: Peng Ding Date: Sun, 29 Dec 2024 03:59:20 -0600 Subject: [PATCH] Update env vars to HOST_UID/GID in docs and configs --- README.md | 2 +- README_en.md | 2 +- compose.custom.yaml | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1f47341..4ad9769 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ docker compose up -f compose.dev.yaml -d ```bash - UID=$(id -u) GID=$(id -g) docker compose -f compose.custom.yaml up -d --build + HOST_UID=$(id -u) HOST_GID=$(id -g) docker compose -f compose.custom.yaml up -d --build ``` ### 为什么需要这些文件? diff --git a/README_en.md b/README_en.md index 91a7621..94f8a39 100644 --- a/README_en.md +++ b/README_en.md @@ -136,7 +136,7 @@ To address this, we provide `compose.custom.yaml` and `Dockerfile.custom` files. ```bash - UID=$(id -u) GID=$(id -g) docker compose -f compose.custom.yaml up -d --build + HOST_UID=$(id -u) HOST_GID=$(id -g) docker compose -f compose.custom.yaml up -d --build ``` ### Why Are These Files Needed? diff --git a/compose.custom.yaml b/compose.custom.yaml index ff980eb..5a23ae9 100644 --- a/compose.custom.yaml +++ b/compose.custom.yaml @@ -2,15 +2,15 @@ services: autossh: build: context: . - dockerfile: Dockerfile.custom # Path to the custom Dockerfile + dockerfile: Dockerfile.custom args: - UID: ${UID:-1000} # Use the host UID or default to 1000 - GID: ${GID:-1000} # Use the host GID or default to 1000 - image: custom-autossh-tunnel:latest # Name of the newly built image + UID: ${HOST_UID:-1000} # Use HOST_UID or default to 1000 + GID: ${HOST_GID:-1000} # Use HOST_GID or default to 1000 + image: custom-autossh-tunnel:latest volumes: - ~/.ssh:/home/myuser/.ssh:ro - ./config.yaml:/etc/autossh/config.yaml:ro environment: - AUTOSSH_GATETIME=0 network_mode: "host" - restart: always + restart: always \ No newline at end of file