在我的测试设置中,我使用docker执行器来运行我的构建。我们几乎所有的项目都运行在一个官方的节点镜像(即node:6)上。
默认情况下,这些官方图像的日志记录级别设置为输出相当大的比特。
根据官方文档,可以禁用
Verbosity
By default the Node.js Docker Image has npm log verbosity set to info instead
of the default warn. This is because of the way Docker is isolated from the
host operating system and
我正在尝试将我的应用程序作为travis ci的一部分进行停靠,这样我就可以将其发布到docker hub: 我已经设置了Dockerfile、docker-compose和travis.yml,当github中的管道完成时,我收到这个错误消息: 0.60s$ docker run mysite /bin/sh -c "cd /root/mysite; bundle exec rake test"
/bin/sh: 1: cd: can't cd to /root/mysite
/bin/sh: 1: bundle: not found
The command
描述
我正在尝试创建一个Jenkinsfile,用于构建图像并将其推送到注册表中。然而,我希望在推动它之前,管道确保所有的测试都通过。
环境
Jenkinsfile
node {
checkout scm
def customImage = docker.build("my-image:test")
customImage.inside {
dir("app"){
// chown was added to try to solve the problem with the suggested
我已在Windows 10专业版计算机上正确安装了Docker CE副本。
我正在尝试使用docker-compose运行一个简单的节点应用程序,并能够在docker中运行时动态更新代码。我跟随构建了它,我的代码可以在中找到。
当我在本地运行代码的同时导航到localhost:8080时,我得到了我的网页。当我通过Docker运行它时,我从我的web浏览器(同样的url)得到"This page it working“。在Docker中运行之前,我已经确保在本地停止运行,这样端口就不会交叉。
我的Dockerfile:
FROM node:6.10.2
RUN useradd --u
我试图将参数传递给docker-compose运行的底层命令,但我不确定如何操作。 下面是我的非docker命令: npm run test:watch -- --verbose --match="matching test name" 它将--verbose --match="matching test name"传递给测试运行器。 现在我想在docker中运行我的测试,但是我不能让它工作: docker-compose run test-service-name -- --verbose --match="matching test name
我有一个使用mongodb和redis的应用程序。
我想在上执行测试,但是每次我运行测试时都会得到以下错误。
命令:docker-compose -p tests run --rm main npm run test
错误:
FAIL test/content/document/content.document.test.ts
● Test suite failed to run
Cannot find module 'request'
at node_modules/request-promise-native/lib/rp.js:8:12
从这个中,我似乎可以从这样的服务中执行一个命令:
docker-compose run SERVICE CMD
但当我跑
docker-compose up pwa npm test
我知道错误了
ERROR: No such service: npm
从我的配置中,它将执行npm start,但我想知道如何执行其他命令。
文件
Dockerfile:
From node:8
WORKDIR /app
copy package.json /app/
RUN npm install --quiet
CMD npm start
docker-compose.yml:
version: '3
为了构建几个微服务并对它们运行测试,我尝试在bitbucket管道中使用docker。但是,我得到了以下错误:
Step 19/19 : COPY . .
Service 'app' failed to build: failed to copy files: failed to copy directory: Error processing tar file(exit status 1): Container ID 166535 cannot be mapped to a host ID
到目前为止,我的docker-compose.yml看起来如下:
version: &
我正在将Docker迁移到Podman,当npm调用时,别名not正在工作。
我在我的env别名上添加了:
alias docker='podman'
alias docker-compose='podman-compose'
为了测试别名,我运行了docker-compose up --build并使用podman-组合正确地工作,就像预期的那样。
我的package.json上有:
"scripts": {
"start": "docker-compose up --build",
...
当我
要缓存node_modules,我首先添加package.json,然后运行npm i inside docker镜像。
这是非常有效的。但我还需要在package.json中包含版本,并且每次部署/构建时我都会递增版本号。
由于package.json已更改,因此docker不会因此而缓存mode_modules。
如何在这个高级文件中缓存node_modules?
FROM node
# If needed, install system dependencies here
# Add package.json before rest of repo for caching
ADD p
错误:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-amplify-project-three@0.1.0 build: `react-scripts --max_old_space_size=2048 build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-amplify-project-three@0.1.0 build script.
npm ERR! This is probably not a problem with npm. T