My container is being built fine with CodePipeline and CodeBuild with this buildspec.yml
file:
build:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- docker build -t $REPOSITORY_URI:latest .
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
- docker run echo 'test' > /var/www/html/.env
The only thing is that the last command is showing this error:
[Container] Running command docker run echo 'teste' > /var/www/html/.env
/codebuild/output/tmp/script.sh: line 4: /var/www/html/.env: No such file or directory
I’m actually trying to create a test file inside the container.
Is this the correct way to do it?