Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot specify source path in container. #602

Open
asannikov opened this issue Feb 27, 2023 · 0 comments
Open

Cannot specify source path in container. #602

asannikov opened this issue Feb 27, 2023 · 0 comments
Labels
CodeBuild-local Tag to track issues and PRs for CodeBuild local Docker image

Comments

@asannikov
Copy link

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

@asannikov asannikov changed the title Cannon specify source path in container. Cannot specify source path in container. Feb 27, 2023
@subinataws subinataws added the CodeBuild-local Tag to track issues and PRs for CodeBuild local Docker image label Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CodeBuild-local Tag to track issues and PRs for CodeBuild local Docker image
Projects
None yet
Development

No branches or pull requests

2 participants