Hey guys,
Unsure if this is even doable. I’ve read a few of the other topics here, but not quite getting it (just started with Drone, so apologies!)
I’m trying to reduce redundancies between drone.yml and my dockerfile.
global-variables:
environment: &default_environment
DNSCRYPT_VERSION: 2.0.45-r1kind: pipeline
type: docker
name: publishsteps:
- name: publish
image: plugins/docker
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
build-args:
- $DNSCRYPT_VERSION
purge: true
repo: modem7/dnstest
tags:
- latest
- $DNSCRYPT_VERSION
FROM alpine:edge
ARG DNSCRYPT_VERSION
ENV DNSCRYPT_V=$DNSCRYPT_VERSIONLABEL description=“A flexible DNS proxy, with support for modern encrypted DNS protocols
such as DNSCrypt v2 and DNS-over-HTTP/2.”
url=“GitHub - DNSCrypt/dnscrypt-proxy: dnscrypt-proxy 2 - A flexible DNS proxy, with support for encrypted DNS protocols.”
version={$DNSCRYPT_V}
ENV LOCAL_PORT 53
RUN apk update &&
apk add --no-cache \
dnscrypt-proxy=$DNSCRYPT_V
drill &&
rm -rf /var/cache/apk/* && rm -rf /tmp/*EXPOSE $LOCAL_PORT/udp
COPY dnscrypt-proxy.toml /etc/dnscrypt-proxy/dnscrypt-proxy.toml
COPY example-dnscrypt-proxy.toml /etc/dnscrypt-proxy/example-dnscrypt-proxy.tomlUSER dnscrypt
HEALTHCHECK --interval=20s --timeout=20s --retries=3 --start-period=10s
CMD drill -p $LOCAL_PORT one.one.one.one @127.0.0.1 || exit 1CMD /usr/bin/dnscrypt-proxy -config /etc/dnscrypt-proxy/dnscrypt-proxy.toml
I’m most likely trying to overcomplicate matters, but effectively my goal is to try to enter the version number only once, and it gets passed through to both the tag and the dockerfile. Is this even doable?
Thanks!