Skip to content

Commit

Permalink
Feat: enable DockerOperator usage (#4)
Browse files Browse the repository at this point in the history
* mount docker.sock & set perms; required for DockerOperator usage 🧦

* Move docker/.env into docker/.env.example
  • Loading branch information
amywieliczka committed Oct 14, 2024
1 parent 6bcabcb commit 6a865fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dags/**/*.pyc
/logs
/db-data
.DS_Store
/docker/.env
3 changes: 2 additions & 1 deletion docker/.env → docker/.env.example
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 6a865fe

Please sign in to comment.