npm install
をDockerfileで実行しようとしていますが、色を無効にしてもDockerhubビルドログに色コードが表示されるようです。npm installでDocker Hubにインストール中に色が表示される
何が間違っていますか?
あなたはドッカーハブ上のビルドの詳細をDockerfileを見つけることができます。https://hub.docker.com/r/amcsi/szeremi/builds/btk4utf3whezxqhnbzpkhyw/
Dockerfile:
FROM node
MAINTAINER Attila Szeremi <[email protected]>
RUN mkdir /src
WORKDIR /src
RUN cd /src
# Copy just the package.json file file as a cache step.
COPY package.json /src/package.json
# Disable progress so npm would install faster.
# Disable colors, because Dockerhub can't display them.
# Install NPM packages excluding the dev dependencies.
RUN npm set progress=false && npm set color=false && npm install --production
COPY . .
RUN npm run build
EXPOSE 8080
CMD ["npm", "run", "start"]
ビルドスクリプトの出力のサンプル:
Step 3 : WORKDIR /src
---> Running in 4a8ec4902bee
---> ce66cec7780b
Removing intermediate container 4a8ec4902bee
Step 4 : RUN cd /src
---> Running in 561c6d10cdb8
---> c12b27e7c01a
Removing intermediate container 561c6d10cdb8
Step 5 : COPY package.json /src/package.json
---> ebbb940c8911
Removing intermediate container c39be008ad46
Step 6 : RUN npm set progress=false && npm set color=false && npm install --production
---> Running in c9ebee32f367
[91mnpm[0m[91m [0m[91minfo[0m[91m [0m[91mit worked if it ends with[0m[91m ok
[0m[91mnpm[0m[91m [0m[91minfo[0m[91m [0m[91musing[0m[91m [email protected]
[0m[91mnpm[0m[91m [0m[91minfo[0m[91m [0m[91musing[0m[91m [email protected]
[0m[91mnpm[0m[91m [0m[91minfo[0m[91m [0m[91mconfig[0m[91m set "progress" "false"
[0m[91mnpm[0m[91m [0m[91minfo[0m[91m ok
[0m[91mnpm[0m[91m [0m[91minfo[0m[91m [0m[91mit worked if it ends with[0m[91m ok
[0m[91mnpm[0m[91m [0m[91minfo[0m[91m [0m[91musing[0m[91m [email protected]
[0m[91mnpm[0m[91m [0m[91minfo[0m[91m [0m[91musing[0m[91m [email protected]
[0m[91mnpm[0m[91m [0m[91minfo[0m[91m [0m[91mconfig[0m[91m set "color" "false"
[0m[91mnpm[0m[91m [0m[91minfo[0m[91m [0m[91mok[0m[91m
[0m[91mnpm[0m[91m [0m[91minfo[0m[91m [0m[91mit worked if it ends with[0m[91m ok
[0m[91mnpm[0m[91m [0m[91minfo[0m[91m [0m[91musing[0m[91m [email protected]
[0m[91mnpm[0m[91m [0m[91minfo[0m[91m [0m[91musing[0m[91m [email protected]
あなたはホストの端末で色を無効にしましたか? – ipinak
このディスプレイ端末には、Dockerファイルのステップがどのように行われたかを示すDocker Hubの出力ビューの色がありません。 –