Skip to content

Commit

Permalink
mount docker.sock & set perms; required for DockerOperator usage 🧦
Browse files Browse the repository at this point in the history
  • Loading branch information
amywieliczka committed Sep 28, 2023
1 parent 32e269b commit f770e5f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ DAGS_HOME=""
PLUGINS_HOME=""
REQS_HOME=""
STARTUP_HOME=""
RIKOLTI_DATA_HOME=""
RIKOLTI_DATA_HOME=""
DOCKER_SOCKET=""
1 change: 1 addition & 0 deletions docker/docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ services:
- "${REQS_HOME}:/usr/local/airflow/requirements"
- "${STARTUP_HOME}:/usr/local/airflow/startup"
- "${RIKOLTI_DATA_HOME}:/usr/local/airflow/rikolti_data"
- "${DOCKER_SOCKET}:/var/run/docker.sock"
ports:
- "8080:8080"
command: local-runner
Expand Down
6 changes: 5 additions & 1 deletion docker/script/run-startup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env bash

source "$AIRFLOW_HOME/startup/startup.sh"
declare -p | grep -v '^declare \-[aAilnrtux]*r ' > stored_env
declare -p | grep -v '^declare \-[aAilnrtux]*r ' > stored_env

# allows the airflow user on the airflow docker container to access
# the host's docker.sock. This is needed for the DockerOperator to work.
sudo chmod 666 /var/run/docker.sock

0 comments on commit f770e5f

Please sign in to comment.