https://pulumi.com logo
#general
Title
# general
g

glamorous-printer-66548

09/10/2018, 5:06 AM
Hi, I’m trying to use
@pulumi/docker
to build an image which is subsequently used for a k8s deployment. The image shall be pushed to a private GCR registry. This is a subset of my current code:
Copy code
const imageName = 'prediction-container-manager-router';

const image = docker.buildAndPushImage(
  'solvvy-dev/prediction-container-manager-router',
  {
    context: './router',
    dockerfile: './router/Dockerfile'
  },
  'solvvy-dev/prediction-container-manager-router',
  null,
  async () => ({
    registry: '<http://gcr.io|gcr.io>',
    username: 'oauth2accesstoken',
    password: execSync('gcloud auth print-access-token').toString('utf8')
  })
);
Pulumi up fails with
Copy code
logging in to registry...

  pulumi:pulumi:Stack: prediction-container-manager-prediction-container-manager-api-cluster-dev-b
    info: denied: requested access to the resource is denied
    error: [runtime] Docker push of image 'solvvy-dev/prediction-container-manager-router' failed with exit code: 1
which is not a very helpful error. Is there some example of how to use gcr? Also what should I pass as
logResource
/ the forth parameter of docker.buildAndPushImage to perhaps get some more useful log output? Currently I’m just passing
null
.