Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
318 views
in Technique[技术] by (71.8m points)

Docker folder gets duplicated in container

Have this Dockerfile

Dockerfile

FROM python:3.8
ADD Pipfile.lock /app/Pipfile.lock
ADD Pipfile /app/Pipfile

WORKDIR /app
COPY . /app

RUN pip install pipenv
RUN pipenv install --system --deploy --ignore-pipfile
ENV FLASK_APP=app/http/api/endpoints.py
ENV FLASK_RUN_PORT=4433
ENV FLASK_ENV=development
ENTRYPOINT ["python"] 
CMD ["-m", "flask", "run"]

Why in the Docker container my app lands in

/app/app/http/api

App gets duplicated

How to copy it to:

/app/http/api

How can I fix it?

Update 1:

My docker-compose and Dockerfile and ls output.

https://0bin.net/paste/ePRws72M#IV8H6iRJ+UMJFr8lB7CRQYKwsnGYflsmOlyvFxZA7zE


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Do you have base OS structure like ? ./app/http/api. If you can see structure like ./app/http/api then change Dockerile instruction to

WORKDIR /app
COPY ./app/ /app
  • what are you getting output in command ls -lhtra ?
  • Can you share the directory structure where this Dockerfile is placed?

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...