Tag: 量angular器

奇怪的错误使用量angular器无头像时

我得到这个错误: $ docker run -it –privileged –rm –net=host -v /dev/shm:/dev/shm -v $(pwd):/protractor webnicer/protractor-headless src/test/e2e/config/local-config.js [20:21:32] I/local – Starting selenium standalone server… [20:21:32] I/launcher – Running 1 instances of WebDriver [20:21:35] I/local – Selenium standalone server started at http://192.168.65.2:47981/wd/hub [20:22:00] E/launcher – null [20:22:00] E/launcher – WebDriverError: null at WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5) at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:639:15) at parseHttpResponse […]

Dockerfile – Angular2

FROM ubuntu:latest RUN apt-get update && apt-get -y upgrade RUN apt-get -y install nodejs RUN apt-get -y install npm RUN apt install nodejs-legacy RUN npm cache clean RUN npm install -g angular-cli –force RUN npm install -g watchman –force ENV HOME=/home/app WORKDIR $HOME RUN ng new angular2 WORKDIR /home/app/angular2 EXPOSE 10000 CMD sudo ng serve […]

运行ionic framework到docker不创build本地文件夹/文件

我是新来的docker,我想创build一个容器,以build立一个nodejs和离子实例。 在我的名为DockerEnv的项目文件夹中,我创build了一个Dockerfile和一个docker-compose.yml 。 这是我的Dockerfile内容: FROM node:6.9.4 # install cordova >=4.2.0 for ionic framework 2 RUN npm install -g cordova@4.2.0 # install ionic 2 framework RUN npm install -g ionic@2.2.1 ENV HOME=/src RUN mkdir $HOME RUN cd $HOME # create an ionic project as seen on the doc here: http://ionicframework.com/docs/v2/setup/tutorial/ RUN ionic start ionic-app –v2 ENV […]

UNMET PEER依赖性angular度

帮助我,请与我的问题。 我正在使用Angular2 / Angular4来构build应用程序,并且在运行命令“npm install”时出现这些错误。 +– UNMET PEER DEPENDENCY @angular/common@4.2.3 +– UNMET PEER DEPENDENCY @angular/compiler@4.2.3 +– UNMET PEER DEPENDENCY @angular/core@4.2.3 +– UNMET PEER DEPENDENCY @angular/forms@4.2.3 事情是,我在node_modules/…中获取了这些模块,我的应用程序工作正常,但是当我尝试使用Docker时,我的问题就开始了: npm ERR! peerinvalid The package @angular/common@4.2.3 does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer @angular/forms@4.2.3 wants @angular/common@4.2.3 npm ERR! peerinvalid Peer @angular/platform-browser@4.2.3 wants @angular/common@4.2.3 npm ERR! […]

Docker中的量angular器testing – asynchronouscallback没有在由jasmine.DEFAULT_TIMEOUT_INTERVAL指定的超时

我已经写了6个e2etesting,使用量angular器为我的Angular2应用程序。 testing在我的Windows 10系统上运行良好。 testing是一致的,并通过所有的时间。 现在我正尝试在CentOS docker容器中运行相同的testing。 testing不一致。 他们一直在失败。 我得到一个错误说 错误:超时 – asynchronouscallback未在由jasmine.DEFAULT_TIMEOUT_INTERVAL指定的超时内调用。 我增加了时间,我已经给了browser.wait(直到存在)在所需的地方,我已经增加了计算资源分配给docker(CPU-3,内存-3328MB)。 似乎没有任何工作。 // Protractor configuration file, see link for more information const { SpecReporter } = require('jasmine-spec-reporter'); exports.config = { allScriptsTimeout: 11000, specs: [ './e2e/**/*.e2e-spec.ts' ], capabilities: { 'browserName': 'chrome', 'chromeOptions': { 'args': [ '–no-sandbox'] } }, directConnect: false, baseUrl: 'http://localhost:3200/', framework: 'jasmine2', […]

Dockerized Angular 4和Django编译成功,但localhost:4200不能正常工作

我想用Django后端和postgresql数据库dockerize Angular 4前端。 在这一刻我的文件如下所示。 我记得确定这是否正确完成? 当我尝试docker-compose up我得到了Angular 4前端和Django后端都成功启动的信息。 不幸的是,当我打开http:// localhost:4200它不起作用(localhost:8001似乎工作): Safari can't open the page because the server unexpectedly dropped the connection 我的日志: django_1 | Django version 1.11, using settings 'project.settings' django_1 | Starting development server at http://0.0.0.0:8001/ django_1 | Quit the server with CONTROL-C. angular_1 | ** NG Live Development Server is listening on […]

将docker-comp的envvariables注入到Angular4应用程序中

我构build了一个简单的Angular4应用程序,它从REST-API获取数据。 我使用docker-compose部署应用程序,但在我需要在服务模块中手动将URL /主机名设置为API之前。 在开发期间,我简单地使用“本地主机”,它做的工作。 在API中,我可以通过docker-compose(部分环境 )注入正确的主机名,因为它在服务器上运行,但是对于angular度来说这是不可能的。 是否有任何最佳做法/指导将主机名/ URL从docker-compose注入到angular-cli应用程序中?

如何确保docker工人只用于我的任务

我有一个使用量angular器写的自动化。 我想通过jenkins运行它。 我的shell命令: docker pull selenium/hub:latest docker pull selenium/node-chrome:latest docker rm -f selenium-hub && echo "container selenium-hub removed" || echo "container selenium-hub does not exist" docker run -d -p 4444:4444 –name selenium-hub selenium/hub:latest docker run -d –link selenium-hub:hub selenium/node-chrome:latest protractor conf.js 一切正常。 我的问题是:我可以绝对相信,只有我的代码运行在docker上和所有其他组件(如我有相同的服务器上运行angular网站)不会使用docker,即我应该采取什么预防措施,如果我的服务器100个不同的应用程序运行,我希望这些应用程序不应该有任何副作用。 就像一些应用程序在nodejs v3上运行,而我的docker有nodejs v5,那么使用nodejs v3的应用程序只能继续在nodejs v3上运行。

Angular-CLI代理不能在Docker中工作

我有一个docker-compose文件,包含我需要的所有项目。 这个docker-compose有一个nginx服务器,mysql,phpmyadmin和php。 在它的顶部,我最近添加了一个angular形容器。 一切工作正常,如果我去localhost:4200,我在angular应用程序,如果我去本地主机:80,我在Laravel后端。 现在我需要对我的后端API做一个简单的经典请求。 我build立了一个代理angular度看起来像这样: { "/api/*": { "target":"http://localhost:80", "secure":false, "changeOrigin":true, "pathRewrite": {"^/api" : ""}, "logLevel":"debug" } } 这是我根据这个主题复制的configuration。 但是,当我尝试拨打电话时,Chrome浏览器正在说http:// localhost:4200 / api / test不存在(错误404),这是正常的。 另一方面,angular度服务器说 HPM] Error occurred while trying to proxy request /test from localhost:4200 to http://localhost:80 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors) 我猜这是来自docker,但我不知道如何解决这个问题。 [编辑] version: '2' services: web_server: restart: always image: nginx:latest ports: – "80:80" […]

无法在docker容器中创build量angular器testing报告

如果我在我的机器上对protractor运行我的testing报告正确生成和截图保存。 我现在的目标是在我要使用docker地方进行自动化testing。 我docker-compose.yml看起来像这样 version: '2' services: app: image: app ports: – 9000:9000 selenium: image: selenium/standalone-chrome ports: – 4444:4444 volumes: – /dev/shm:/dev/shm protractor: volumes: – ./tmp:/assets/tmp image: test command: "dockerize -wait http://selenium:4444 -wait http://app:9000 -timeout 60m protractor /assets/conf.js" 问题在于报告和屏幕截图没有保存到卷中。 如果不是使用docker图像作为量angular器,而是使用本地应用程序和selenium图像正确工作。 出于testing目的,我已经在我的卷(本地)上手动添加了该文件夹,并且可以看到该文件夹​​正在被删除,所以我假定链接是正确的。 我的conf.js作为准备添加记者的方法就像 onPrepare: function() { jasmine.getEnv().addReporter(new HtmlReporter({ baseDirectory: '/assets/tmp/screenshots' })); } } 记者用的是量angular器-html-截图记者 。 我的问题是问题在哪里,报告的path,权限等,以及可能是一个修复或替代方法 提前致谢