My dockerfile on local is working fine, I pushed the code to github and then configured a CodePipeline but it fails in the CodeBuild stage.
I am not using AWS ECR but DockerHub, currently it fails in CodeBuild provisioning step with following error:
BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE: Unable to pull customer's container image. CannotPullContainerError: Error response from daemon: manifest for dipuvish5/nest_api_server:latest not found: manifest unknown: manifest unknown
My buildspec.yml is saved in github repository root folder and is as follows:
env:
variables:
DOCKERHUB_USERNAME: "*******"
IMAGE_REPO_NAME: "nest_api_server"
IMAGE_TAG: "latest"
DOCKERHUB_PASS: "*******"
phases:
pre_build:
commands:
- echo Logging in to Docker Hub...
- docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASS
build:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- docker build -t $IMAGE_REPO_NAME:$IMAGE_TAG .
- docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$IMAGE_TAG
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker image...
- docker push $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$IMAGE_TAG
Kindly ignore docker password in the buidspec.yml, here we are deliberately using password in file as its a temporary project and needs to be deleted in few days and it does not contain any important details