Skip to content

Commit 76639f1

Browse files
authored
Revamp dockerfile for office-ui-fabric to reduce noise (#40147)
* Revamp dockerfile for office-ui-fabric to reduce noise and better handle recent changes to project structure * Revert baseline change so it can be in the normal update, use node 12 since its LTS
1 parent a7c306f commit 76639f1

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed
+13-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
FROM node:current
1+
# Lock to node 12 because the codebase throws hundreds of `Warning: Accessing non-existent property` warnings in node 14
2+
FROM node:12
23
ENV CI=true
34
ENV TF_BUILD=true
4-
RUN npm install -g yarn lerna --force
5+
# Download repo version, sets up better layer caching for the following clone
6+
ADD https://api.github.com/repos/OfficeDev/office-ui-fabric-react/git/ref/heads/master version.json
57
RUN git clone https://github.com/OfficeDev/office-ui-fabric-react.git /office-ui-fabric-react
68
WORKDIR /office-ui-fabric-react
79
RUN git pull
10+
WORKDIR /
811
COPY --from=typescript/typescript /typescript/typescript-*.tgz typescript.tgz
9-
# Sync up all TS versions used internally to the new one
10-
WORKDIR /office-ui-fabric-react/scripts
11-
RUN yarn add typescript@../typescript.tgz --exact --dev --ignore-scripts
12-
WORKDIR /office-ui-fabric-react/packages/tsx-editor
13-
RUN yarn add typescript@../../typescript.tgz --exact --ignore-scripts
14-
WORKDIR /office-ui-fabric-react/packages/migration
15-
RUN yarn add typescript@../../typescript.tgz --exact --ignore-scripts
16-
WORKDIR /office-ui-fabric-react/apps/vr-tests
17-
RUN yarn add typescript@../../typescript.tgz --exact --ignore-scripts
18-
WORKDIR /office-ui-fabric-react/apps/todo-app
19-
RUN yarn add typescript@../../typescript.tgz --exact --ignore-scripts
2012
WORKDIR /office-ui-fabric-react
21-
RUN yarn
22-
ENTRYPOINT [ "lerna" ]
23-
CMD [ "run", "build", "--stream", "--concurrency", "1", "--loglevel", "error", "--", "--production", "--lint", "--silent" ]
13+
# Sync up all TS versions used internally to the new one (we use `npm` because `yarn` chokes on tarballs installed
14+
# into multiple places in a workspace in a short timeframe (some kind of data race))
15+
RUN npx lerna exec --stream --concurrency 1 -- npm install /typescript.tgz --exact --ignore-scripts
16+
RUN npx yarn
17+
# Perform scss task to generate scss code if present
18+
RUN npx lerna exec --stream --concurrency 1 --bail=false -- yarn run just scss
19+
ENTRYPOINT [ "npx" ]
20+
CMD [ "lerna", "exec", "--stream", "--concurrency", "1", "--loglevel", "error", "--bail=false", "--", "yarn", "run", "just", "ts"]

0 commit comments

Comments
 (0)