I'd like to mount host's aws credential to astro airflow container, but it didn't recognize it.
Astro CLI Version: 1.11.0 Host OS: Ubuntu 20.04
How to reproduce:
$ mkdir temp && cd temp && astro dev init
- Update
packages.txt
awscli
- Create file
docker-compose.override.yml
version: "3.1"
services:
scheduler:
volumes:
- /home/MYUSER/.aws:/home/astro/.aws
webserver:
volumes:
- /home/MYUSER/.aws:/home/astro/.aws
triggerer:
volumes:
- /home/MYUSER/.aws:/home/astro/.aws
$ astro dev start
$ astro dev bash
$ ls -alh ~/
stro@733abc2fc20b:/usr/local/airflow$ ls -alh ~/
total 32K
drwxr-xr-x 1 astro astro 4.0K Mar 24 10:35 .
drwxr-xr-x 1 root root 4.0K Mar 17 18:40 ..
drwxrwxr-x 2 1000 1000 4.0K Mar 23 23:31 .aws --> I can see the mounted `.aws`
-rw------- 1 astro astro 49 Mar 24 10:35 .bash_history
-rw-r--r-- 1 astro astro 220 Mar 27 2022 .bash_logout
-rw-r--r-- 1 astro astro 3.5K Mar 27 2022 .bashrc
-rw-r--r-- 1 astro astro 807 Mar 27 2022 .profile
$ aws s3 ls
--> Unable to locate credentials. You can configure credentials by running "aws configure".
Strange thing is, if I do same process using ubuntu
image, it works well
$ mkdir temp2 && cd temp2
Dockerfile
FROM ubuntu:22.04
RUN export TZ=Asia/Seoul && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update \
&& apt-get install -y awscli
CMD ["sleep", "6000"]
docker-compose.yml
services:
chois:
build: .
volumes:
- /home/MYUSER/.aws:/root/.aws
$ docker-compose up -d
$ docker-compose exec chois /bin/bash
$ aws s3 ls
---> It worked well without an error.
Why does it happen only in astro app? anything that I missed?