diff --git a/.changeset/spotty-paws-think.md b/.changeset/spotty-paws-think.md index 7e59a0f641..552b65d7e6 100644 --- a/.changeset/spotty-paws-think.md +++ b/.changeset/spotty-paws-think.md @@ -1,6 +1,5 @@ --- '@backstage/cli': patch -'@backstage/create-app': patch --- Support `.npmrc` when building with private NPM registries diff --git a/packages/create-app/templates/default-app/package.json.hbs b/packages/create-app/templates/default-app/package.json.hbs index 8ee5666033..975a5a2ed2 100644 --- a/packages/create-app/templates/default-app/package.json.hbs +++ b/packages/create-app/templates/default-app/package.json.hbs @@ -8,7 +8,7 @@ "scripts": { "start": "yarn workspace app start", "build": "lerna run build", - "build-image": "DOCKER_BUILDKIT=1 yarn workspace backend build-image", + "build-image": "yarn workspace backend build-image", "tsc": "tsc", "tsc:full": "tsc --skipLibCheck false --incremental false", "clean": "backstage-cli clean && lerna run clean", diff --git a/packages/create-app/templates/default-app/packages/backend/Dockerfile b/packages/create-app/templates/default-app/packages/backend/Dockerfile index aeed5054f0..50514713d3 100644 --- a/packages/create-app/templates/default-app/packages/backend/Dockerfile +++ b/packages/create-app/templates/default-app/packages/backend/Dockerfile @@ -1,4 +1,3 @@ -# syntax = docker/dockerfile:1.0-experimental FROM node:12-buster WORKDIR /usr/src/app @@ -6,9 +5,9 @@ WORKDIR /usr/src/app # Copy repo skeleton first, to avoid unnecessary docker cache invalidation. # The skeleton contains the package.json of each package in the monorepo, # and along with yarn.lock and the root package.json, that's enough to run yarn install. -ADD .npmrc* yarn.lock package.json skeleton.tar ./ +ADD yarn.lock package.json skeleton.tar ./ -RUN --mount=type=secret,id=NPM_TOKEN NPM_TOKEN=$(cat /run/secrets/NPM_TOKEN) yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)" +RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)" # This will copy the contents of the dist-workspace when running the build-image command. # Do not use this Dockerfile outside of that command, as it will copy in the source code instead.