No description
Find a file
2024-12-01 18:50:57 +01:00
.github Buildah docker build & push 2021-05-13 21:07:16 +05:30
cmd Add secrets support 2024-12-01 18:07:32 +01:00
docker Add secrets support 2024-12-01 18:07:32 +01:00
scripts Add secrets support 2024-12-01 18:07:32 +01:00
.drone.yml (maint) move to harness.drone.io 2022-12-07 13:58:28 +00:00
.gitignore Buildah docker build & push 2021-05-13 21:07:16 +05:30
buildah.go Fix typo 2024-12-01 18:50:57 +01:00
buildah_test.go Add secrets support 2024-12-01 18:07:32 +01:00
go.mod Add secrets support 2024-12-01 18:07:32 +01:00
go.sum Add secrets support 2024-12-01 18:07:32 +01:00
LICENSE Buildah docker build & push 2021-05-13 21:07:16 +05:30
README.md Add secrets support 2024-12-01 18:07:32 +01:00
tags.go Add secrets support 2024-12-01 18:07:32 +01:00
tags_test.go Add first secret support 2024-11-14 11:37:22 +01:00

drone-buildah

Build Status Gitter chat Join the discussion at https://discourse.drone.io Drone questions at https://stackoverflow.com Go Doc Go Report

Drone plugin uses buildah to build and publish Docker images to a container registry. For the usage information and a listing of the available options please take a look at the docs.

Build

Build the binaries with the following commands:

export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on

go build -v -a -tags netgo -o release/linux/amd64/buildah-docker ./cmd/buildah-docker
go build -v -a -tags netgo -o release/linux/amd64/buildah-gcr ./cmd/buildah-gcr
go build -v -a -tags netgo -o release/linux/amd64/buildah-ecr ./cmd/buildah-ecr
go build -v -a -tags netgo -o release/linux/amd64/buildah-acr ./cmd/buildah-acr
go build -v -a -tags netgo -o release/linux/amd64/buildah-heroku ./cmd/buildah-heroku

Docker

Build the Docker images with the following commands:

docker build \
  --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
  --file docker/docker/Dockerfile.linux.amd64 --tag ymage/buildah-docker .

docker build \
  --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
  --file docker/gcr/Dockerfile.linux.amd64 --tag ymage/buildah-gcr .

docker build \
  --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
  --file docker/ecr/Dockerfile.linux.amd64 --tag ymage/buildah-ecr .

docker build \
  --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
  --file docker/acr/Dockerfile.linux.amd64 --tag ymage/buildah-acr .

docker build \
  --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
  --file docker/heroku/Dockerfile.linux.amd64 --tag ymage/buildah-heroku .

Usage

docker run --rm \
  -e PLUGIN_TAG=latest \
  -e PLUGIN_REPO=octocat/hello-world \
  -e DRONE_COMMIT_SHA=d8dbe4d94f15fe89232e0402c6e8a0ddf21af3ab \
  --cap-add=SYS_ADMIN \
  -v $(pwd):$(pwd) \
  -w $(pwd) \
  ymage/buildah-docker --dry-run