Skip to content

Commit

Permalink
Update env vars to HOST_UID/GID in docs and configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Oaklight committed Dec 29, 2024
1 parent ce7d003 commit 90916b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

### 为什么需要这些文件?
Expand Down
2 changes: 1 addition & 1 deletion README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
10 changes: 5 additions & 5 deletions compose.custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 90916b1

Please sign in to comment.