我想要做的是使用我在网上找到的Docker图像timwiconsulting/ionic-v1.3,并在Docker中运行我的离子项目。我想在Docker中安装我的离子项目并转发我的端口,以便我可以在浏览器中运行模拟器。
我想问一下如何为现有容器创建docker-compose.yml文件?
我找到了一个我想要运行的Docker镜像timwiconsulting/ionic-v1.3,它具有我想要的正确版本的工具。
现在我想创建一个撰写文件,将端口转发到我的计算机,然后挂载项目文件。我创建了这个docker-compose.yml
文件:
version: '3'
services:
web:
build: .
ports:
- "8100:8100"
- "35729:35729"
volumes:
- /Users/leetcat/project/:/project
但每次我尝试docker-compose up
时都会收到错误:
~/user: docker-compose up
Building web
Step 1/6 : FROM timwiconsulting:ionic-v1.3
ERROR: Service 'web' failed to build: pull access denied for timwiconsulting, repository does not exist or may require 'docker login
我做错了什么。我想我想为容器timwiconsulting/ionic-v1.3创建一个docker-compose.yml
文件。随意告诉我,我完全不知道Docker是什么。
这是我的Dockerfile:
# Use an official Python runtime as a parent image
FROM timwiconsulting:ionic-v1.3
# Set the working directory to /app
WORKDIR /project
# Copy the current directory contents into the container at /app
ADD . /project
# Install any needed packages specified in requirements.txt
# RUN pip install --trusted-host pypi.python.org -r requirements.txt
# Make port 80 available to the world outside this container
EXPOSE 8100
EXPOSE 35729
# Define environment variable
ENV NAME World
# Run app.py when the container launches
# CMD ["python", "app.py"]
# docker exec -it <container_hash> /bin/bash/