Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Support for building DVS as Docker Managed Plugin. #1006

Merged
merged 2 commits into from
Mar 8, 2017

Conversation

msterin
Copy link
Contributor

@msterin msterin commented Mar 8, 2017

See issue #886
Docker managed plugins are currently documented here

This PR introduces new folder ./plugin. Running make all in this folder will assume that
the DVS is pre-built and dockerhub is authenticared with docker login, then it will package DVS
as a Managed Plugin, and push to dockerhub.

Note that this is not integrated with Build or CI - since we do Build under Docker, a bit more work is needed in central Makefile and drone script - I will do it in a separate PR if this one will be approved/merged soon, or in an extension to this one if it will still be in review.

See Makefile for name/tag and location.

Assuming the Makefile defines names as 'cnastorage/docker-volume-vsphere:0.12', the plugin could
be installed on Docker (1.13+) as follows:

  • no question asked, and pretend the plugin name is 'vsphere' (can be used in volume create and plugin rm)
docker plugin install --grant-all-permissions --alias vsphere cnastorage/docker-volume-vsphere:0.12
  • vanilla interactive install as disabled plugin (will require docker plugin enable to be operational
docker plugin install --disable cnastorage/docker-volume-vsphere:0.12

The docker volume command behaves as before but the plugin name in docker create is either what was passed as --alias or the full plugin name , i.e. cnastorage/docker-volume-vsphere:0.12

Docker managed plugins are currently documented [here](https://docs.docker.com/engine/extend/)

This PR introduces new folder `./plugin`. Running `make all` in this folder will assume that
the DVS is pre-built and dockerhub is authenticared with (`docker login`), then it will  package DVS
as a Managed Plugin, and push to dockerhub.

See Makefile for name/tag and location.

Assuming the Makefile defines names as 'cnastorage/docker-volume-vsphere:0.12', this plugin then could
be installed on Docker (1.13+) as follows:

* no question asked, and pretend the plugin name is 'vsphere' (can be used in `volume create` and `plugin rm`
```
docker plugin install --grant-all-permissions --alias vsphere cnastorage/docker-volume-vsphere:0.12
```
* vanilla interactive install as disabled
```
docker plugin install --disable cnastorage/docker-volume-vsphere:0.12
```
Copy link
Contributor

@pdhamdhere pdhamdhere left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! Looks good to me as long as it does what it is supposed to do :-)

One comment below otherwise LGTM.

plugin/Makefile Outdated
BINARY := docker-volume-vsphere
BIN_LOC := ../build

# Tmp docker image used to constuct rootfs + our banaries
Copy link
Contributor

Choose a reason for hiding this comment

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

typo banaries => binaries

"Documentation": "http://vmware.github.io/docker-volume-vsphere/documentation",
"Entrypoint": ["/usr/bin/docker-volume-vsphere", "--log_level", "info"],
"PropagatedMount": "/mnt/vmdk",
"Mounts": [
Copy link
Contributor

Choose a reason for hiding this comment

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

What about "/etc/" for /etc/docker-volume-vsphere.conf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah. I did not want to open up all important folders. I think I will change it to /etc/vmware/ and open /etc/vmware. Comments ?

USER := cnastorage

PLUGIN_NAME=$(USER)/docker-volume-vsphere
PLUGIN_TAG=0.12
Copy link
Contributor

Choose a reason for hiding this comment

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

Later we will have to find a way to separate dev builds from release tags.

Copy link
Contributor

@shaominchen shaominchen left a comment

Choose a reason for hiding this comment

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

LGTM.

@msterin msterin merged commit 8759272 into master Mar 8, 2017
@msterin msterin deleted the managed_plugin.msterin branch March 8, 2017 21:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants