Merge pull request #8410 from SuperTux88/allow-DOCKER_HOST-env-var
Allow DOCKER_HOST env var for diaspora-dev docker setup
This commit is contained in:
commit
e29f9e2fa2
2 changed files with 4 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
FROM amd64/ruby:2.7-slim-bullseye
|
FROM docker.io/amd64/ruby:2.7-slim-bullseye
|
||||||
|
|
||||||
RUN DEBIAN_FRONTEND=noninteractive \
|
RUN DEBIAN_FRONTEND=noninteractive \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
|
|
|
||||||
|
|
@ -179,8 +179,10 @@ print_usage_full() {
|
||||||
# ----- Helper functions -----
|
# ----- Helper functions -----
|
||||||
|
|
||||||
dia_docker_compose() {
|
dia_docker_compose() {
|
||||||
|
local docker_socket="${DOCKER_HOST:-"unix:///var/run/docker.sock"}"
|
||||||
|
docker_socket="${docker_socket#unix://}"
|
||||||
# Check permissions of docker socket and use sudo if needed
|
# Check permissions of docker socket and use sudo if needed
|
||||||
if [ -r "/var/run/docker.sock" ] && [ -w "/var/run/docker.sock" ]; then
|
if [ -r "${docker_socket}" ] && [ -w "${docker_socket}" ]; then
|
||||||
docker-compose "$@"
|
docker-compose "$@"
|
||||||
else
|
else
|
||||||
echo "Attention: Docker socket not writable, using sudo for the docker command. You might be asked for your password now." >&2
|
echo "Attention: Docker socket not writable, using sudo for the docker command. You might be asked for your password now." >&2
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue