Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Conversation

@bergwolf
Copy link
Member

This PR adds support protocol (git, http and https) based volume mapping to hyper run command. For each protocol based volume, a new volume is created and filled in with contents pointed by the protocol URL.

http://

[lear@getdvm]$pkt run -d -v https://github.com/nginxinc/docker-nginx/raw/master/stable/alpine/Dockerfile:/data busybox
3326018a72d759141aa51136c5273260a4b4fef53107d66615128ef6af505165
[lear@getdvm]$pkt exec 3326018a72d759141aa51136c5273260a4b4fef53107d66615128ef6af505165 df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdb              10190100     38080   9611348   0% /
devtmpfs                250552         0    250552   0% /dev
tmpfs                   253344         0    253344   0% /dev/shm
/dev/sda              10190100     36900   9612528   0% /data
share_dir                 1024         4      1020   0% /etc/hosts
[lear@getdvm]$pkt exec 3326018a72d759141aa51136c5273260a4b4fef53107d66615128ef6af505165 ls /data
Dockerfile

git over http:

[lear@getdvm]$pkt run -d -v https://github.com/nginxinc/docker-nginx.git:/data busybox
79ca01052ca2b00c756d0fd49eee4a3110b6d30f88d07b08304bf53a0e0be359
[lear@getdvm]$pkt exec -t 79ca01052ca2b00c756d0fd49eee4a3110b6d30f88d07b08304bf53a0e0be359 ls /data
README.md  mainline   stable
[lear@getdvm]$pkt exec 79ca01052ca2b00c756d0fd49eee4a3110b6d30f88d07b08304bf53a0e0be359 df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda              10190100     38080   9611348   0% /
devtmpfs                250552         0    250552   0% /dev
tmpfs                   253344         0    253344   0% /dev/shm
/dev/sdb              10190100     37168   9612260   0% /data
share_dir                 1024         4      1020   0% /etc/hosts

git://

[lear@getdvm]$pkt run -d -v git://git.kernel.org/pub/scm/devel/pahole/pahole.git:/data busybox
510986f6721ae039e4bd819d86facd5dd302e523a3e8992431cae6616f81bc75
[lear@getdvm]$pkt exec -t 510986f6721ae039e4bd819d86facd5dd302e523a3e8992431cae6616f81bc75 ls
bin   data  dev   etc   home  lib   proc  root  sys   tmp   usr   var
[lear@getdvm]$pkt exec 510986f6721ae039e4bd819d86facd5dd302e523a3e8992431cae6616f81bc75 df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdb              10190100     38080   9611348   0% /
devtmpfs                250552         0    250552   0% /dev
tmpfs                   253344         0    253344   0% /dev/shm
/dev/sda              10190100     39152   9610276   0% /data
share_dir                 1024         4      1020   0% /etc/hosts

bergwolf added 2 commits May 30, 2016 16:56
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Currently only git:// protocol is supported.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
continue
}
if execID, err = cli.ExecCmd(initConfig.User, createResponse.ID, cmd); err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

cleanup is needed. (WaitExec() and destroy created volume)

Copy link
Member Author

@bergwolf bergwolf May 30, 2016

Choose a reason for hiding this comment

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

Upon failure, created volumes are destroyed together with container at line 152 above.
And I don't quite get why we still need WaitExec() if container is removed.

bergwolf added 2 commits June 1, 2016 15:08
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
@bergwolf
Copy link
Member Author

bergwolf commented Jun 1, 2016

updated to fix a minor issue with git url parsing.

@laijs
Copy link
Contributor

laijs commented Jun 15, 2016

LGTM, I merge this at first. #119 need to fix

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.

2 participants