drone-docker-tagger

command module
v0.0.0-...-512d776 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

README

drone-docker-tagger

Build Go Doc Go Report

This Drone plugin takes in a source_image and creates one or more new tags and pushes it to the Docker repo specified. See example usage below.

Example usage:

pipeline:
  build:
    image: chatkitinc/drone-docker-tagger
    source_image: source/image:tag
    registry: <your registry>
    username: ${REGISTRY_USERNAME}
    password: ${REGISTRY_PASSWORD}
    tags:
      - tag1
      - tag2
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:rw

Build

Build the binary with the following commands:

go build
go test

Docker

Build the docker image with the following commands:

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo
docker build --rm=true -t chatkitinc/drone-docker-tagger .

Please note incorrectly building the image for the correct x64 linux and with GCO disabled will result in an error when running the Docker image:

docker: Error response from daemon: Container command
'/bin/drone-docker-tagger' not found or does not exist..

Usage

Execute from the working directory:

docker run --rm \
  -e PLUGIN_TAG=latest \
  -e PLUGIN_SOURCE_IMAGE=octocat/hello-world \
  -e PLUGIN_TAGS=tag1,tag2 \
  -v $(pwd):$(pwd) \
  -w $(pwd) \
  --privileged \
  chatkitinc/drone-docker-tagger --dry-run

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL