Skip to content

Cannot specify source path in container. #602

Open
@asannikov

Description

@asannikov

Issue
I'm getting error on trying to use -s : format:
ERROR: for agent-resources_build_1 Cannot create container for service build: b'invalid mode: /codebuild/output/srcDownload/src'

Steps to reproduce the behavior:

  1. Create a project with src folder in the root.
  2. Create buildspec.yml in the src folder
  3. run command from the root path: ./codebuild_build.sh -i public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:4.0 -a ./log -d -s ./src:/app -m

Expected behavior
At least one phase should be called.

Logs

Build Command:

docker run -it -v /var/run/docker.sock:/var/run/docker.sock -e "IMAGE_NAME=public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:4.0" -e "ARTIFACTS=/..replaced../artifacts" -e "SOURCE=/..replaced../src:./src" -e "MOUNT_SOURCE_DIRECTORY=TRUE" -e "DOCKER_PRIVILEGED_MODE=TRUE" -e "INITIATOR=anton" public.ecr.aws/codebuild/local-builds:latest

Stopping agent-resources_agent_1 ... done
Removing agent-resources_agent_1 ... done
Removing network agent-resources_default
Removing volume agent-resources_source_volume
Removing volume agent-resources_user_volume
Creating network "agent-resources_default" with the default driver
Creating volume "agent-resources_source_volume" with local driver
Creating volume "agent-resources_user_volume" with local driver
Creating agent-resources_agent_1 ... done
Creating agent-resources_build_1 ... error

ERROR: for agent-resources_build_1  Cannot create container for service build: b'invalid mode: /codebuild/output/srcDownload/src'

ERROR: for build  Cannot create container for service build: b'invalid mode: /codebuild/output/srcDownload/src'
ERROR: Encountered errors while bringing up the project.

Platform:

  • OS: Mac x86
  • Docker 20.10.22.

Additional context
It works well if i run without the container's path:
./codebuild_build.sh -i public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:4.0 -a ./log -d -s ./src: -m

Metadata

Metadata

Assignees

No one assigned

    Labels

    CodeBuild-localTag to track issues and PRs for CodeBuild local Docker image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions