sam build with --use container doesn't work if sam is running inside a container
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
I am trying to build my lambda package inside a container with latest aws-sam-cli installed. Consider a scenario with a Jenkins or any CI server running inside containers.
Here are the reproduction steps:
- Run a container in interactive mode with aws-sam-cli installed.
`docker run -v /var/run/docker.sock:/var/run/docker.sock -ti --entrypoint bash samcli:latest`
- Run sam Build command `sam build -u -t template.yml`
- Expected: Sam build should be able to executed with `--use-container` option
- Actual: Getting an error with `Requirements file not found: /tmp/samcli/source/requirements.txt`
> root@d2da5d926823:/# sam build -u -t aws.cfn.app.yml
Starting Build inside a container
Building codeuri: / runtime: python3.8 metadata: {} functions: ['KafkaLagLambdaFn']
Fetching public.ecr.aws/sam/build-python3.8:latest Docker container image......
Mounting / as /tmp/samcli/source:ro,delegated inside runtime container
Build Failed
Running PythonPipBuilder:ResolveDependencies
Error: PythonPipBuilder:ResolveDependencies - Requirements file not found: /tmp/samcli/source/requirements.txt
Contributor guide
Assessment
This issue has not been assessed yet.