I have a docker image Im setting up like this
FROM python:3.7-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential libssl-dev python3.7-dev curl && \
rm -rf /var/lib/apt/lists/*
COPY mypackage/
ENV PATH /root/.poetry/bin:${PATH}
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python && \
cd mypackage && \
poetry install && \
mkdir /workingdir
WORKDIR /mypackge
ENTRYPOINT [ "/bin/sh", "-c" ]
and I can enter it locally and run poetry run mypackage run
I can also use docker image exec poetry run mypackage run
and it works
Im deploying to AWS ECR and running the container from AWS batch.
command I am firing atm is, Ive tried with and without the bash -c
"command": ["bash", "-c", "poetry", "run", "mypackage", "run"],
but I always fail to find poetry, I put a simple echo or something in and container works. Its like it doesnt have access to the $PATH env var when launching from aws batch
cloudwatch logs show
run: poetry: command not found
and in step Ive had
container process caused \"exec: \\\"poetry\\\": executable file not found in $PATH\": unknown",
so it seems it doesn see the PATH env var in the container when running from AWS batch but it does locally using exec.
how can I make this work from AWS batch rather than just locally?