File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -10,3 +10,22 @@ RUN pip install --no-cache-dir -r docs/requirements.txt
10
10
11
11
# install streamlit requirements
12
12
RUN pip install --no-cache-dir -r streamlit_app/requirements.txt
13
+
14
+ # install AWS CLI and Copilot CLI
15
+ USER root
16
+ # download AWS CLIs to /tmp to avoid write error (23) from curl command
17
+ WORKDIR /tmp
18
+
19
+ ARG HOST_ARCH
20
+ RUN if [ "$HOST_ARCH" = "amd64" ]; then \
21
+ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" ; \
22
+ elif [ "$HOST_ARCH" = "arm64" ]; then \
23
+ curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" ; \
24
+ fi \
25
+ && unzip awscliv2.zip \
26
+ && ./aws/install \
27
+ && rm -rf aws awscliv2.zip
28
+
29
+ RUN curl -Lo copilot https://github.com/aws/copilot-cli/releases/latest/download/copilot-linux \
30
+ && chmod +x copilot \
31
+ && mv copilot /usr/local/bin/copilot
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
set -eux
3
3
4
+ # Get host architecture for dev container
5
+ ARCH=$( uname -m)
6
+ # Normalize architecture
7
+ case " $ARCH " in
8
+ x86_64) ARCH=" amd64" ;;
9
+ aarch64) ARCH=" arm64" ;;
10
+ esac
11
+
4
12
docker compose build app
5
13
6
- docker compose build dev
14
+ HOST_ARCH= $ARCH docker compose build dev
7
15
8
16
docker compose build streamlit
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ services:
14
14
build :
15
15
context : .
16
16
dockerfile : .devcontainer/Dockerfile
17
+ args :
18
+ HOST_ARCH : ${HOST_ARCH}
17
19
image : caltrans/pems:dev
18
20
env_file : .env
19
21
# https://code.visualstudio.com/docs/remote/create-dev-container#_use-docker-compose
You can’t perform that action at this time.
0 commit comments