diff --git a/Dockerfile.aws-sam-cli-build-image-python3.10 b/Dockerfile.aws-sam-cli-build-image-python3.10 index 2c63491..00f5e29 100644 --- a/Dockerfile.aws-sam-cli-build-image-python3.10 +++ b/Dockerfile.aws-sam-cli-build-image-python3.10 @@ -1,4 +1,4 @@ -FROM linuxbrew/brew:latest +FROM homebrew/brew:latest RUN brew install groff RUN brew install libyaml diff --git a/Dockerfile.aws-sam-cli-build-image-python3.9 b/Dockerfile.aws-sam-cli-build-image-python3.9 index 44751bb..5ab35ce 100644 --- a/Dockerfile.aws-sam-cli-build-image-python3.9 +++ b/Dockerfile.aws-sam-cli-build-image-python3.9 @@ -1,4 +1,4 @@ -FROM linuxbrew/brew:latest +FROM homebrew/brew:latest RUN brew install groff RUN brew install libyaml diff --git a/Dockerfile.py310 b/Dockerfile.py310 index c42c575..4280298 100644 --- a/Dockerfile.py310 +++ b/Dockerfile.py310 @@ -1,7 +1,7 @@ FROM nsidc/aws-sam-cli-build-image-python3.10:latest -RUN curl -sSL https://install.python-poetry.org | python3 - -ENV PATH "$PATH:/root/.local/bin" +RUN curl -sSL https://install.python-poetry.org | python3.10 - +ENV PATH "$PATH:/root/.local/bin:/home/linuxbrew/.local/bin" COPY sam_build.sh /sam_build.sh diff --git a/build.sh b/build.sh index 93717c9..2a8a215 100755 --- a/build.sh +++ b/build.sh @@ -40,6 +40,7 @@ docker build -t ${DOCKER_IMAGE_TAG} "${BUILDER_DIR}" -f "${DOCKERFILE}" # run the build script on the docker container docker run \ + --user root \ -v /var/run/docker.sock:/var/run/docker.sock \ -v "${PROJECT_DIR}":"${PROJECT_DIR}" \ -e PROJECT_DIR="${PROJECT_DIR}" \ diff --git a/sam_build.sh b/sam_build.sh index b36ddd6..b63adc7 100755 --- a/sam_build.sh +++ b/sam_build.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -ex # run this on the docker container; works on host too if environment variables # set and sam is installed @@ -31,7 +31,9 @@ export SAM_CLI_TELEMETRY=0 REQUIREMENTS_FILE="${PROJECT_DIR}/src/requirements.txt" if [ ! -f "${REQUIREMENTS_FILE}" ]; then + echo "No requirements file found, generating one..." cd "${PROJECT_DIR}" + poetry self add poetry-plugin-export poetry export -f requirements.txt --output "${REQUIREMENTS_FILE}" cd - fi