Skip to content

Commit 8ed50a6

Browse files
bachyajoao-p-marques
authored andcommitted
Add environment variable to configure Docker socket location in image
1 parent 08910fe commit 8ed50a6

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ENV ALLOW_RESTARTS=0 \
2222
SECRETS=0 \
2323
SERVICES=0 \
2424
SESSION=0 \
25+
SOCKET_PATH=/var/run/docker.sock \
2526
SWARM=0 \
2627
SYSTEM=0 \
2728
TASKS=0 \

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ extremely critical but can expose some information that your service does not ne
140140
- `TASKS`
141141
- `VOLUMES`
142142

143+
## Use a different Docker socket location
144+
145+
If your OS stores its Docker socket in a different location, you can specify this via
146+
the `SOCKET_PATH` environment variable.
147+
148+
For example, [balenaOS](https://www.balena.io/os/) exposes its socket at `/var/run/balena-engine.sock`. To accommodate this, merely set the `SOCKET_PATH` environment variable to `/var/run/balena-engine.sock`.
149+
143150
## Development
144151

145152
All the dependencies you need to develop this project (apart from Docker itself) are

haproxy.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ defaults
3737
errorfile 504 /usr/local/etc/haproxy/errors/504.http
3838

3939
backend dockerbackend
40-
server dockersocket /var/run/docker.sock
40+
server dockersocket $SOCKET_PATH
4141

4242
frontend dockerfrontend
4343
bind :2375

0 commit comments

Comments
 (0)