forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.sh
executable file
·37 lines (28 loc) · 1023 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -o errexit -o nounset -o pipefail
v="$(./scripts/make-version.sh tag)"
t=${IMAGE_TAG:-}
if [[ -n "$t" ]]; then
v=$t
fi
echo "version=${v}"
image="${DOCKER_REGISTRY}/erda-telegraf:${v}"
echo "image=${image}"
#docker build -t "${image}" \
# --label "branch=$(git rev-parse --abbrev-ref HEAD)" \
# --label "commit=$(git rev-parse HEAD)" \
# --label "build-time=$(date '+%Y-%m-%d %T%z')" \
# -f "Dockerfile" .
#docker push "${image}"
docker login -u "${DOCKER_REGISTRY_USERNAME}" -p "${DOCKER_REGISTRY_PASSWORD}" "${DOCKER_REGISTRY}"
buildctl --addr tcp://buildkitd.default.svc.cluster.local:1234 \
--tlscacert=/.buildkit/ca.pem \
--tlscert=/.buildkit/cert.pem \
--tlskey=/.buildkit/key.pem \
build \
--frontend dockerfile.v0 \
--opt platform=${PLATFORMS} \
--local context=/.pipeline/container/context/telegraf \
--local dockerfile=/.pipeline/container/context/telegraf \
--output type=image,name=${image},push=true
echo "image=${image}" >> $METAFILE