8000 Fix docs so WORKDIR mentions it works for COPY and ADD too by duglin · Pull Request #10351 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix docs so WORKDIR mentions it works for COPY and ADD too #10351

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

Merged
merged 1 commit into from
Jan 29, 2015

Conversation

duglin
Copy link
Contributor
@duglin duglin commented Jan 26, 2015

The docs around COPY/ADD already mentioned that it will do a relative
copy/add based on WORKDIR, so that part is already ok. Just needed to
tweak the WORKDIR section since w/o mentioning COPY/ADD it can be misleading.

Noticed by @phemmer in #10345

Signed-off-by: Doug Davis dug@us.ibm.com

@phemmer
Copy link
Contributor
phemmer commented Jan 26, 2015

As mentioned in #10345, this does not appear to be correct:

# cat Dockerfile
FROM busybox
RUN mkdir /test
RUN ls -la /test
WORKDIR /test
COPY bar foo
RUN ls -la /test /foo

# docker build --no-cache -t test . 
Sending build context to Docker daemon 3.072 kB
Sending build context to Docker daemon 
Step 0 : FROM busybox
 ---> e72ac664f4f0
Step 1 : RUN mkdir /test
 ---> Running in e52a30b38530
 ---> 3d744923157f
Removing intermediate container e52a30b38530
Step 2 : RUN ls -la /test
 ---> Running in 7d95401a882a
total 0
drwxr-xr-x    1 root     root             0 Jan 26 13:39 .
drwxr-xr-x    1 root     root           182 Jan 26 13:39 ..
 ---> b41bcfb9ffc8
Removing intermediate container 7d95401a882a
Step 3 : WORKDIR /test
 ---> Running in cf74222ab16f
 ---> f7d0d5506498
Removing intermediate container cf74222ab16f
Step 4 : COPY bar foo
 ---> 1378597af325
Removing intermediate container 90d2b02a1096
Step 5 : RUN ls -la /test /foo
 ---> Running in 85bcb50a0f8a
-rw-r--r--    1 root     root             4 Jan 26 13:32 /foo

/test:
total 0
drwxr-xr-x    1 root     root             0 Jan 26 13:39 .
drwxr-xr-x    1 root     root           188 Jan 26 13:39 ..
 ---> e89df5d4980f
Removing intermediate container 85bcb50a0f8a
Successfully built e89df5d4980f

@duglin
Copy link
Contributor Author
duglin commented Jan 26, 2015

@phemmer is in an older version, the latest docker acts as I described.

@SvenDowideit
Copy link
Contributor

LGTM - though the same change needs to go into docs/man/Dockerfile.5.md :)

@fredlf @jamtur01

The docs around COPY/ADD already mentioned that it will do a relative
copy/add based on WORKDIR, so that part is already ok.  Just needed to
tweak the WORKDIR section since w/o mentioning COPY/ADD it can be misleading.

Noticed by @phemmer

Signed-off-by: Doug Davis <dug@us.ibm.com>
@duglin
Copy link
Contributor Author
duglin commented Jan 27, 2015

@SvenDowideit thanks for noticing - I've updated Dockerfile.5.md now

@jamtur01
Copy link
Contributor

LGTM

jamtur01 added a commit that referenced this pull request Jan 29, 2015
Fix docs so WORKDIR mentions it works for COPY and ADD too
@jamtur01 jamtur01 merged commit ba8e167 into moby:master Jan 29, 2015
@duglin duglin deleted the FixDocsWorkdir branch February 4, 2015 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0