docs icon indicating copy to clipboard operation
docs copied to clipboard

Give example of VOLUME command for Dockerfile

Open lythix opened this issue 9 years ago • 12 comments

The command line method of creating a volume to "Mount a host directory as a data volume" is (for example)

docker run -p 1433:1433 -e SA_PASSWORD=blah e ACCEPT_EULA=Y -v H:/Data:/var/opt/mssql -d microsoft/mssql-server-linux

What would the equivalent Dockerfile syntax be? Give an example under the VOLUME section

File: engine/reference/builder.md, CC @mstanleyjones

lythix avatar Apr 01 '17 00:04 lythix

#dibs for the hackathon

jpooler avatar Apr 17 '17 12:04 jpooler

Read the note here https://docs.docker.com/engine/tutorials/dockervolumes/#mount-a-shared-storage-volume-as-a-data-volume

You cant mount host directory from Dockerfile as the image we are going to build should be host dir independent.

bhavin192 avatar Apr 17 '17 17:04 bhavin192

No action for two days, so this is up for grabs again!

mdlinville avatar Apr 19 '17 18:04 mdlinville

@mstanleyjones please consider my comment. It is not possible to do same with Dockerfile as we do while running a container.

Read the note here https://docs.docker.com/engine/tutorials/dockervolumes/#mount-a-shared-storage-volume-as-a-data-volume

You cant mount host directory from Dockerfile as the image we are going to build should be host dir independent.

Should it be clarified here again? Just copying Note from here will be fine?

If yes, then I will do it.

bhavin192 avatar Apr 19 '17 18:04 bhavin192

claimed

tippexs avatar Apr 19 '17 19:04 tippexs

@bhavin192 were you intending to claim this? If so, you were first. If not, please let @tippexs know they can have it.

mdlinville avatar Apr 19 '17 19:04 mdlinville

@mstanleyjones yes, I want to claim it.

bhavin192 avatar Apr 19 '17 19:04 bhavin192

These files cannot be edited from here so I created PR https://github.com/moby/moby/pull/32735

bhavin192 avatar Apr 20 '17 06:04 bhavin192

Being reviewed upstream. :)

mdlinville avatar Apr 20 '17 16:04 mdlinville

Merged upstream. Thanks @bhavin192 !

mdlinville avatar Apr 25 '17 17:04 mdlinville

Closed via https://github.com/moby/moby/pull/32735

mdlinville avatar Apr 25 '17 17:04 mdlinville

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked

docker-robott avatar Mar 07 '23 03:03 docker-robott