Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a preference option to set docker build context path #158

Merged
merged 1 commit into from
Nov 8, 2017

Conversation

nyamakawa
Copy link
Contributor

@nyamakawa nyamakawa commented Oct 27, 2017

I have a multiple docker project which has common pip requirements.

Project files are:

  • docker
    • local
      • app
        • Dockerfile
    • production
      • app
        • Dockerfile
  • requirements
    • requirements.txt

And Dockerfile is like:
FROM python:3.6 COPY ./requirements /requirements/ RUN pip install -r /requirements/requirements.txt ...

I was trying to build image from "Build Image" context menu,
but build was failed on COPY line with some error:

"COPY failed: stat /var/lib/docker/tmp/docker-builder282882071/requirements: no such file or directory"

VSCode generated below command:
docker build local-app -f docker/local/app/Dockerfile docker/local/app/Dockerfile

Since 'docker build' send files below build context path to docker-machine to build image,
and do not see parent directories SO link , I modified command manually :
docker build local-app -f docker/local/app/Dockerfile ./
and this time it is succeeded.

If image build context path can be set from workspace preference, it may be useful.
So I wrote a little patch.
I confirmed this issue in Docker tool box for mac and Mac Docker.

Thank you.

@msftclas
Copy link

msftclas commented Oct 27, 2017

CLA assistant check
All CLA requirements met.

Copy link
Member

@chrisdias chrisdias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chrisdias chrisdias merged commit 1953372 into microsoft:master Nov 8, 2017
@microsoft microsoft locked and limited conversation to collaborators Oct 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants