2016-05-21 01:28:22 +05:30
|
|
|
# drone-docker
|
2015-05-15 10:42:50 +05:30
|
|
|
|
2017-08-28 00:59:08 +05:30
|
|
|
Drone plugin to build and publish Docker images to a container registry.
|
2016-01-18 04:50:19 +05:30
|
|
|
|
2016-05-04 04:47:16 +05:30
|
|
|
## Build
|
|
|
|
|
|
|
|
Build the binary with the following commands:
|
|
|
|
|
|
|
|
```
|
2017-08-28 00:59:08 +05:30
|
|
|
sh .drone.sh
|
2016-05-04 04:47:16 +05:30
|
|
|
```
|
2015-05-15 10:42:50 +05:30
|
|
|
|
|
|
|
## Docker
|
|
|
|
|
2017-08-11 04:16:30 +05:30
|
|
|
Build the Docker image with the following commands:
|
2016-05-04 04:47:16 +05:30
|
|
|
|
|
|
|
```
|
2017-08-28 00:59:08 +05:30
|
|
|
docker build --rm=true -f docker/Dockerfile -t plugins/docker .
|
2016-05-04 04:47:16 +05:30
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2016-07-23 02:55:49 +05:30
|
|
|
Execute from the working directory:
|
2016-05-04 04:47:16 +05:30
|
|
|
|
|
|
|
```
|
|
|
|
docker run --rm \
|
|
|
|
-e PLUGIN_TAG=latest \
|
|
|
|
-e PLUGIN_REPO=octocat/hello-world \
|
|
|
|
-e DRONE_COMMIT_SHA=d8dbe4d94f15fe89232e0402c6e8a0ddf21af3ab \
|
2016-05-05 01:21:06 +05:30
|
|
|
-v $(pwd):$(pwd) \
|
2016-05-04 05:04:08 +05:30
|
|
|
-w $(pwd) \
|
|
|
|
--privileged \
|
2016-05-04 04:47:16 +05:30
|
|
|
plugins/docker --dry-run
|
2015-05-15 10:42:50 +05:30
|
|
|
```
|