两个类似的docker compose文件不会给出相同的结果
这是我在两个类似的docker compose文件不会给出相同的结果,docker,docker-compose,dockerfile,cypress,Docker,Docker Compose,Dockerfile,Cypress,这是我在/中的Dockerfile: FROM cypress/base:10 COPY package.json package.json # to install all the necessary packages from packages.json RUN npm i # copy in the tests, fixtures, plugins and any custom commands COPY ./cypress ./cypress COPY ./cypress.json ./
/
中的Dockerfile
:
FROM cypress/base:10
COPY package.json package.json
# to install all the necessary packages from packages.json
RUN npm i
# copy in the tests, fixtures, plugins and any custom commands
COPY ./cypress ./cypress
COPY ./cypress.json ./cypress.json
RUN $(npm bin)/cypress verify
RUN $(npm bin)/cypress run
这是我的docker compose.yml
文件,其中的测试在访问pa门户时没有问题:8080
version: '3.8'
services:
pa-portal:
image: company-docker-registry.company.net/project/web_page:latest
container_name: pa-portal
volumes:
- productDB:/project_webpage/db
ports:
- "8080:8080"
cypress:
image: "cypress/included:4.4.0"
depends_on:
- pa-portal
environment:
- CYPRESS_baseUrl=http://pa-portal:8080
working_dir: /cypress-testing
volumes:
- ./:/cypress-testing
volumes:
productDB:
然而,我意识到我需要自己的依赖项(因此我创建了自己的Dockerfile),但我没有更改“pa门户”服务中的任何内容,但我的测试显示“尝试加载失败”http://pa-portal:8080,使用我命名为docker compose copy.yml的以下文件
version: '3.8'
services:
pa-portal:
image: company-docker-registry.company.net/project/web_page:latest
container_name: pa-portal
volumes:
- productDB:/project_webpage/db
ports:
- "8080:8080"
cypress:
build: ./
depends_on:
- pa-portal
volumes:
- productDB:/db
volumes:
productDB:
旧容器是否仍在运行,或者即使已停止,也未移除?docker container ls-a
是否显示有用于pa门户
服务的容器?@MarkoEdocker container ls-a
没有显示任何容器,我甚至进行了系统删减。旧容器是否仍在运行,或者即使停止也没有删除?docker container ls-a
是否显示有用于pa门户
服务的容器?@MarkoEdocker container ls-a
没有显示任何容器,我甚至进行了系统删减