version: 0.2

phases:
  build:
    commands:
      - echo "Building a docker image"
      - docker login -u \$oauthtoken -p $NGC_TOKEN nvcr.io
      - docker build -t $IMAGE_NAME:latest-1.0 --build-arg ISAACSIM_VERSION_ARG=4.0.0 --build-arg ISAACSIM_ROOT_PATH_ARG=/isaac-sim --build-arg ISAACLAB_PATH_ARG=/workspace/isaaclab --build-arg DOCKER_USER_HOME_ARG=/root -f docker/Dockerfile.base .
      - echo "Pushing the docker image"
      - docker push $IMAGE_NAME:latest-1.0
      - docker tag $IMAGE_NAME:latest-1.0 $IMAGE_NAME:latest-1.0-b$CODEBUILD_BUILD_NUMBER
      - docker push $IMAGE_NAME:latest-1.0-b$CODEBUILD_BUILD_NUMBER
