尝试时
Shortcut.add(messageField, Key.ENTER, sendButton::click);
带有以下Shortcut.add(messageField, Key.ENTER, sendButton::click, Key.SHIFT);
:
docker build \
--tag my-app:latest \
.
以及以下Dockerfile
:
FROM node:9-stretch AS intermediate
ARG NPM_TOKEN
COPY [".npmrc", "./"]
RUN ["chmod", "0600", ".npmrc"]
COPY ["package.json", "./"]
RUN ["npm", "install"]
FROM node:9-stretch
WORKDIR /usr/src/app/
COPY --from=intermediate ["node_modules/.", "./node_modules/."]
COPY ["package.json", "index.js", "./"]
CMD ["node", "index.js"]
我在.npmrc
容器的步骤//registry.npmjs.org/:_authToken=${NPM_TOKEN}
中收到以下错误:
Step 6/14 : RUN ["npm", "install"]
我的intermediate
中的Bash shell和Error: Failed to replace env in config: ${NPM_TOKEN}
at /usr/local/lib/node_modules/npm/lib/config/core.js:417:13
at String.replace (<anonymous>)
at envReplace (/usr/local/lib/node_modules/npm/lib/config/core.js:413:12)
at parseField (/usr/local/lib/node_modules/npm/lib/config/core.js:391:7)
at /usr/local/lib/node_modules/npm/lib/config/core.js:334:17
at Array.forEach (<anonymous>)
at Conf.add (/usr/local/lib/node_modules/npm/lib/config/core.js:333:23)
at ConfigChain.addString (/usr/local/lib/node_modules/npm/node_modules/config-chain/index.js:244:8)
at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:321:10)
at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:525:3)
/usr/local/lib/node_modules/npm/lib/npm.js:61
throw new Error('npm.load() required')
^
Error: npm.load() required
at Object.get (/usr/local/lib/node_modules/npm/lib/npm.js:61:13)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at process.emit (events.js:180:13)
at process._fatalException (internal/bootstrap/node.js:391:27)
中的Z shell还有以下行:
.bashrc
我根据发现的here官方NPM文档,以此方式将.zshrc
添加到我的Docker映像中。