dockerfile:在多个存储库上运行工具

时间:2019-07-04 16:47:40

标签: docker dockerfile

我有一个cli工具,可以使用docker创建E2E测试套件。基本思想是在Docker容器中,我将构建本地代码,然后在多个公共存储库上运行该工具。这样做的主要目的是使查看CLI工具可能需要添加的所有缺少功能变得更加容易。

我确实设法使其正常运行,但是由于所有的链接和文件夹管理,管理起来有点麻烦。

typing.TypeVar

我试图弄清楚如何使用WORKDIR来更改目录,这样可以清理很多东西,但是能够相互引用工作目录似乎没有用。

关于我如何清理此dockerfile的任何建议?

1 个答案:

答案 0 :(得分:0)

当然,在我发布问题之后,我会找出答案(做')

## Build a node application
from node:8.11.1

## Sortier creation, build and test
WORKDIR /sortier
COPY . .
RUN npm install --unsafe-perm
RUN npm run test

## react-redux-typescript-guide/playground
WORKDIR /react-redux-typescript-guide
RUN git clone https://github.com/piotrwitek/react-redux-typescript-guide .
WORKDIR /react-redux-typescript-guide/playground
RUN npm install --unsafe-perm
RUN echo "{ isHelpMode: true }" > .sortierrc
WORKDIR /sortier
RUN npm run start -- "/react-redux-typescript-guide/playground/src/**/*.ts"
RUN npm run start -- "/react-redux-typescript-guide/playground/src/**/*.tsx"
WORKDIR /react-redux-typescript-guide/playground
RUN npm run build
RUN set CI=true&&npm run test

## prettier
WORKDIR /prettier
RUN git clone https://github.com/prettier/prettier
WORKDIR /prettier
RUN npm install --unsafe-perm
RUN echo "{ isHelpMode: true }" > .sortierrc
WORKDIR /sortier
RUN npm run start -- "/prettier/src/**/*.js"
WORKDIR /prettier
RUN npm run build
RUN npm run test