0

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:

  1. $ mkdir temp && cd temp && astro dev init
  2. Update packages.txt
awscli
  1. 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
  1. $ astro dev start
  2. $ astro dev bash
  3. $ 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
  1. $ 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

  1. $ mkdir temp2 && cd temp2
  2. 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"]
  1. docker-compose.yml
services:
  chois:
    build: .
    volumes:
      - /home/MYUSER/.aws:/root/.aws
  1. $ docker-compose up -d
  2. $ docker-compose exec chois /bin/bash
  3. $ aws s3 ls ---> It worked well without an error.

Why does it happen only in astro app? anything that I missed?

user3595632
  • 5,380
  • 10
  • 55
  • 111

0 Answers0