aws / aws/aws-sam-cli

'docker-volume-basedir' option for 'sam build' command

Open
#963 6 comments 4 reactions 0 assignees View on GitHub
area/build area/docker maintainer/need-response type/feature type/ux
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

### Describe your idea/feature/enhancement

Currently, `sam build --use-container` does not work when using a remote Docker host (e.g., like the one in [this guide](https://www.kevinkuszyk.com/2016/11/28/connect-your-docker-client-to-a-remote-docker-host/)), even though the project directory exists on the remote machine. Unlike `sam local`, the `sam build` command has no `docker-volume-basedir` option and does not respect the `SAM_DOCKER_VOLUME_BASEDIR` environment variable. Furthermore, the `base-dir` option does not behave like `docker-volume-basedir`, as `sam build` makes the assumption that `base-dir` is on the local machine.

### Proposal

Add the `docker-volume-basedir` option to the `sam build` command and have [ApplicationBuilder](https://github.com/awslabs/aws-sam-cli/blob/v0.10.0/samcli/lib/build/app_builder.py#L183) treat it just like [InvokeContext](https://github.com/awslabs/aws-sam-cli/blob/v0.10.0/samcli/commands/local/cli_common/invoke_context.py#L249) does (no path conversion or resolution).

Things to consider:
1. Will this require any updates to the [SAM Spec](https://github.com/awslabs/serverless-application-model) **No**

### Additional Details

Due to the advanced nature of this setup, some notes would need to be added to the documentation explicitly warning users that the project directory must exist on the remote host at the path specified by `docker-volume-basedir`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.