Tag: npm

如何将一个node.js docker实例放入一个自动加载日志的shell中

所以… 我正在尝试为我的团队在绿地原型项目上创build一个优雅的docker/节点设置。 我的团队将需要事先安装Node / NPM和Docker CLI,但之后我将使用NPM来pipe理所有内容,并且以前有… "scripts": { "docker": "npm run docker-build && npm run docker-start", "docker-build": "docker build -t docker_foo .", "docker-start": "docker run -it -p 8080:8080 –rm docker_foo", "start": "node server.js" } …和Dockerfile包含CMD … # Other stuff… EXPOSE 8080 CMD ["npm", "start"] 最终将启动节点服务器。 这对于查看日志和清理容器非常有效,但是我想把它变得更好。 我想改为在后台使用-d选项启动容器,并附加到容器,而不是使用初始命令拖尾日志来模拟相同的行为,除了当用户终止进程时,它们仍然在容器中他们可以评估容器的当前状态。 这导致我有… "scripts": { "docker": "npm run docker-build && […]

Dokku / Docker部署应用程序失败

Docker noob在这里,所以忍受着我。 我有一个configurationdokku的VPS,它有多个应用程序已经运行。 我正在尝试添加一个相当复杂的应用程序。 但docker工人失败,出现以下错误。 从我的理解,我需要更新包的错误给出。 问题是他们需要一些其他模块,我不能更新它。 是一种使docker避开警告和构build的方法。 以下是我的docker的内容 FROM mhart/alpine-node:6 # Create app dir RUN mkdir -p /app WORKDIR /app # Install dependancy COPY package.json /app RUN npm install # Bundle the app COPY . /app EXPOSE 9337 CMD ["npm", "start"] 一直试着这几天没有成功。 任何帮助不胜感激 谢谢。

在npm安装期间,Gitlab CI失败

你好我有一个退出代码1错误期间安装在我的docker容器,在gitlab持续集成的生成期间安装。 我有一个JavaScript web应用程序在nodejs和托pipe在gitlab上的angularjs,有两个存储库:一个用于前端,另一个用于后端。 对于前面的内容,我使用包含节点7.7.1和nginx的基本映像,并在Amazonregistry中托pipe它,然后运行器根据package.json执行前端的npm安装。 这里是.gitlab-ci.yml: image: docker:1.13.1 stages: – build – test – deploy variables: BUILD_IMG: $CI_REGISTRY_IMAGE:$CI_BUILD_REF TEST_IMG: $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME RELEASE_IMG: $CI_REGISTRY_IMAGE:latest AWS_STAGING_ENV: "argalisformation-prod-env" AWS_PROD_ENV: "argalisformation-prod-env" DOCKERRUN: Dockerrun.aws.json DEPLOY_ARCHIVE: ${AWS_APP}-${CI_BUILD_REF}.zip before_script: – docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com – .ci/before_script build: stage: build script: – docker build –pull -t $BUILD_IMG . – docker push $BUILD_IMG […]

docker中npm更新失败

我不能更新docker中的npm package xxx npm update -g 要么 npm install -g xxx 更新后,我不能执行xxx,并抛出 Error: Cannot find module 'semver' 所以我必须要 npm uninstall -g xxx npm install -g xxx 每次我想更新软件包时重新安装。 如何更新docker中的npm包?

由于ubuntu的未满足的依赖关系,无法安装节点6的npm

这是错误消息: Step 6/10 : RUN apt-get install -y npm —> Running in 85acc9ae3f0d Reading package lists… Building dependency tree… Reading state information… Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created […]

webpack通过改进dockerfile来改善自动化

我运行想知道如何更好地使用docker自动化我的npm项目。 我正在使用一个Vue.js项目的webpack。 当我运行npm run buld ./dist我得到一个输出文件夹./dist这很好。 如果我然后通过docker build -t projectname .build立一个docker镜像docker build -t projectname . 并运行这个容器都是完美的工作。 这是我的Dockerfile(在这里find) FROM httpd:2.4 COPY ./dist /usr/local/apache2/htdocs/ 但是如果我可以构builddocker镜像而不需要通过npm run build手动构build项目,那将会很好。 你明白我的问题吗? 有什么可能的解决scheme?

NaCl辅助程序在没有沙箱的情况下运行! 运行npmtesting时出错

运行npmtesting时遇到问题。 我收到的错误是:“NaCl助手进程运行没有沙箱!”,这是真实的,因为我正在运行与“ – 无沙箱”选项的浏览器。 我必须运行这个选项,因为浏览器以root身份运行,我没有select运行它的一个不同的用户(这是一个docker的形象)。 任何人都可以帮我把它整理出来吗? PS我正在以下列方式安装浏览器: RUN apt-get update RUN apt-get install -y nodejs npm RUN wget -q -O – https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add – RUN sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' RUN apt-get install -y apt-transport-https RUN apt-get update RUN apt-get install -y google-chrome-stable 提前致谢!

如何在gitlab-ci-runner-docker中使用docker和npm

我用docker docker:dind作为服务使用gitlab-ci。 问题 我正在尝试在Gitlab-CI运行npm run build然后由docker build 。 我可以通过这种方式在Docker中使用docker构build: 这是我的跑步者config.toml : $ cat /etc/gitlab-runner/config.toml concurrent = 4 check_interval = 0 [[runners]] name = "developers_gitlab_school-gitlab-runner-docker" url = "https://school.domain.com" token = "cd09f40c6a4….a44751fec795e35" executor = "docker" builds_dir = "/mnt/mesos/sandbox/builds" cache_dir = "/mnt/mesos/sandbox/cache" [runners.docker] tls_verify = false image = "docker:latest" privileged = true disable_cache = false volumes = ["/cache"] […]

用Express和Docker暴露3000以外的端口

我使用Docker来运行一个快速应用程序,一切都很好,如果我在端口3000上运行它。我使用的Dockerfile是 FROM node:boron # Create app directory RUN mkdir -p /usr/src/app WORKDIR /usr/src/app # Install app dependencies COPY package.json /usr/src/app/ RUN npm install # Bundle app source COPY . /usr/src/app EXPOSE 3000 CMD ["npm", "start" ] 我现在想要在端口3500上运行它。我调整了Dockerfile FROM node:boron # Create app directory RUN mkdir -p /usr/src/app WORKDIR /usr/src/app # Install app dependencies COPY package.json […]

Docker:容器内由npm创build的文件权限

我有一个Dockerfile来创build一个开发环境来开发一个sailsJS应用程序。 我只是将我的源代码安装到容器中。 我在我的主机上做了我的Git提交,但是我想在容器中执行所有的npm命令。 我有以下的Dockerfile,我在Ubuntu 14.10中运行Docker(1.4.1): FROM ubuntu:14.04 ### Utils ### RUN apt-get update RUN apt-get -y install build-essential git wget tar vim supervisor ### MongoDB ### RUN apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv 7F0CEB10 RUN echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/mongodb.list RUN apt-get update RUN apt-get install -y mongodb-org RUN mkdir -p /data/db ### […]