i just built R2 support into our container last night. i have the access key id and secret key in th

i just built R2 support into our container last night. i have the access key id and secret key in the env of the worker, and i set the environment variables when i invoke the container itself.

this.container.start({
  // Need egress
  enableInternet: true,
  // Set env vars for R2 access in the container
  env: {
    R2_ENDPOINT_URL: `https://${this.env.CLOUDFLARE_ACCOUNT_ID}.r2.cloudflarestorage.com`,
    R2_ACCESS_KEY_ID: this.env.R2_ACCESS_KEY_ID,
    R2_SECRET_ACCESS_KEY: this.env.R2_SECRET_ACCESS_KEY,
    R2_BUCKET_NAME: this.env.BUNDLE_R2_BUCKET_NAME,
  },
});


no need to use ENV commands in the Dockerfile!
Was this page helpful?