首次使用docker。请帮忙!
我明白了。我该如何解决?
Step 3/7 : COPY package*.json ./
ERROR: Service 'buyer' failed to build: COPY failed: no source files were specified
我的代码文件在一个文件夹下运行。我将它们放在其他文件夹中以创建docker。我的文件结构如下所示
├── buyer
│ ├── Dockerfile
│ ├── client.js
│ ├── index.html
│ └── iotaModule.js
├── seller
│ ├── Dockerfile
│ ├── index.js
│ └── iotaModule.js
├── docker-compose.yml
├── node_modules
├── package.json
├── package-lock.json
├── .dockerignore
我的卖方dockerfile
FROM node:10
WORKDIR /seller
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD [ "node", "index.js" ]
我的买方dockerfile
FROM node:10
WORKDIR /buyer
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 8080
CMD [ "node", "client.js" ]
我的docker-compose.yml
version: '3'
services:
seller:
container_name: docker_seller
build: seller/
ports:
- '3000:3000'
depends_on:
- buyer
buyer:
container_name: docker_buyer
build: buyer/
ports:
- '8080:8080'
答案 0 :(得分:0)
<%# app/views/reservation_mailer/confirmation_email.text.erb %>
Hello,
You are registering for <%= @event.name %>.
Click here to confirm your email: <%= event_reservation_url(@event, @reservation) %>.
Thanks
无法正常工作。我将package,json放在子文件夹中,并且可以正常工作。可能不是最好的方法。