Hi,
I'm still really struggling with this unfortunately. After reading the
docker documentation on volumes (-v), it seems I still can't get the
required packer syntax correct.
The following, manages to create /root/dockershare inside of the container
(and if it doesn't exist on the host, it will create it as well). However,
if I create a file on the host, it simply doesn't appear inside the
container (and vise-versa).
Am I misunderstanding something fundamental here ?
2018/11/21 09:15:55 packer: 2018/11/21 09:15:55 Starting container with
args: [run -v /home/root/dockershare:/root/dockershare
"builders": [{
"type": "docker",
"image": "ubuntu",
"commit": true,
"pull": true,
"volumes": {"/home/root/dockershare": "/root/dockershare"}
Many thanks!
On Sunday, November 4, 2018 at 12:23:52 PM UTC+1, Rickard von Essen wrote:
>
> These options (as most in Packer) are just passed to the underlying tool
> and is best understood by reading the docs of the tool, and experimenting
> with it without Packer.
>
> See
> https://docs.docker.com/engine/reference/commandline/commit/#parent-command
>
> And https://docs.docker.com/storage/volumes/#choose-the--v-or---mount-fla
>
> On Sun, Nov 4, 2018, 11:58 Alvaro Miranda Aguilera <[email protected]
> <javascript:> wrote:
>
>> try
>>
>>
>> "builders": [{
>> "type": "docker",
>> "image": "centos",
>> "commit": true,
>> "pull": true,
>> "volumes": [
>> "/home/evan/code": "/tmp/code"
>> ]
>> }],
>>
>> alvaro
>>
>>
>> On Sun, Nov 4, 2018 at 11:30 AM <[email protected] <javascript:>> wrote:
>>
>>> Thanks for the reply. There is no documented examples that I can see,
>>> for using VOLUMES. Would you be able to point me in the right direction
>>> with some sample code ? :)
>>>
>>>
>>>
>>> On Sunday, November 4, 2018 at 11:24:09 AM UTC+1, Rickard von Essen
>>> wrote:
>>>>
>>>> I think you are looking for *) volumes, changes VOLUMES will only
>>>> affect the resulting image.
>>>>
>>>> *) https://packer.io/docs/builders/docker.html#volumes
>>>>
>>>> On Sun, Nov 4, 2018 at 10:45 AM <[email protected]> wrote:
>>>>
>>>>> Hi All!
>>>>>
>>>>> I'm quite new to this, and was trying to map a local folder
>>>>> /home/evan/code into a docker image, to test sharing code between the
>>>>> two.
>>>>> I have the following code below, however it seems the entire local root
>>>>> volume is trying to be mounted into /tmp/code. Is this by design ? The
>>>>> container is running as root, however of course my local folder is owned
>>>>> by
>>>>> my user - if that is effecting things potentially ?. How do I simply
>>>>> mount
>>>>> the local folder /home/evan/code to /tmp/code inside of the container ?
>>>>>
>>>>> Many thanks!
>>>>>
>>>>>
>>>>> /dev/mapper/mint--vg-root 213G 12G 191G 6% /tmp/code
>>>>>
>>>>>
>>>>> "builders": [{
>>>>> "type": "docker",
>>>>> "image": "centos",
>>>>> "commit": true,
>>>>> "pull": true,
>>>>> "changes": [
>>>>> "VOLUME /home/evan/code /tmp/code"
>>>>> ]
>>>>> }],
>>>>>
>>>>> --
>>>>> This mailing list is governed under the HashiCorp Community Guidelines
>>>>> - https://www.hashicorp.com/community-guidelines.html. Behavior in
>>>>> violation of those guidelines may result in your removal from this
>>>>> mailing
>>>>> list.
>>>>>
>>>>> GitHub Issues: https://github.com/mitchellh/packer/issues
>>>>> IRC: #packer-tool on Freenode
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Packer" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/packer-tool/8b78defe-3d56-48fd-80d9-8644d97a3876%40googlegroups.com
>>>>>
>>>>> <https://groups.google.com/d/msgid/packer-tool/8b78defe-3d56-48fd-80d9-8644d97a3876%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>> --
>>> This mailing list is governed under the HashiCorp Community Guidelines -
>>> https://www.hashicorp.com/community-guidelines.html. Behavior in
>>> violation of those guidelines may result in your removal from this mailing
>>> list.
>>>
>>> GitHub Issues: https://github.com/mitchellh/packer/issues
>>> IRC: #packer-tool on Freenode
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Packer" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected] <javascript:>.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/packer-tool/ea48533a-f0b0-4583-81d4-cb0b788b5898%40googlegroups.com
>>>
>>> <https://groups.google.com/d/msgid/packer-tool/ea48533a-f0b0-4583-81d4-cb0b788b5898%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Alvaro
>>
>> --
>> This mailing list is governed under the HashiCorp Community Guidelines -
>> https://www.hashicorp.com/community-guidelines.html. Behavior in
>> violation of those guidelines may result in your removal from this mailing
>> list.
>>
>> GitHub Issues: https://github.com/mitchellh/packer/issues
>> IRC: #packer-tool on Freenode
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Packer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/packer-tool/CAHqq0ewk6u5oT10vS_X3%2Bb-FUuWb2Ohm-sVyR-K1RWe1vX_6Cg%40mail.gmail.com
>>
>> <https://groups.google.com/d/msgid/packer-tool/CAHqq0ewk6u5oT10vS_X3%2Bb-FUuWb2Ohm-sVyR-K1RWe1vX_6Cg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/packer-tool/83ff8256-db5d-4ba7-a7e9-182a01e54d04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.