docker-with-buildx/.drone.yml

51 lines
1.4 KiB
YAML

---
kind: pipeline
type: docker
name: docker-with-buildx
steps:
- name: docker build an publish
image: hub.docker.struchkov.dev/docker:24.0.7-dind-alpine3.18
environment:
DOCKER_REGISTRY_TOKEN:
from_secret: DOCKER_REGISTRY_TOKEN
DOCKER_IMAGE_NAME:
from_secret: DOCKER_IMAGE_NAME
DOCKER_REGISTRY_USER:
from_secret: DOCKER_REGISTRY_USER
volumes:
- name: dockersock
path: /var/run
commands:
- sleep 15
- echo "$DOCKER_REGISTRY_TOKEN" | docker login docker.struchkov.dev --username $DOCKER_REGISTRY_USER --password-stdin
- echo "$DOCKER_REGISTRY_TOKEN" | docker login hub.docker.struchkov.dev --username $DOCKER_REGISTRY_USER --password-stdin
- docker build --no-cache -t "docker.struchkov.dev/docker-buildx:latest" -t "docker.struchkov.dev/docker-buildx:$DRONE_TAG" .
- docker push "docker.struchkov.dev/docker-buildx:latest"
- docker push "docker.struchkov.dev/docker-buildx:$DRONE_TAG"
trigger:
ref:
- refs/tags/v.*.*.*
services:
- name: docker
image: hub.docker.struchkov.dev/docker:24.0.7-dind-alpine3.18
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
image_pull_secrets:
- DOCKER_AUTH
---
kind: signature
hmac: d6f7a9f87f18f7016513f0bceda904b4ec7a68f6daffe3ce36de4c5e77b2f9a7
...