This repository has been archived by the owner on Dec 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdevfile-buildkit.yaml
68 lines (60 loc) · 2.07 KB
/
devfile-buildkit.yaml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright (c) 2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# See: https://sipb.mit.edu/doc/safe-shell/
apiVersion: 1.0.0
metadata:
name: buildkit-tooling-dev
projects:
- name: che-sidecar-kubernetes-tooling
source:
location: 'https://github.com/che-dockerfiles/che-sidecar-kubernetes-tooling'
type: git
branch: '1.1.0'
components:
- type: chePlugin
id: moby/buildkit/latest
alias: buildkit-dev
memoryLimit: 1500Mi
commands:
#
# Generate config.json with credentials to the Container Registry
#
- name: '1.1 Specify Container Registry'
actions:
- workdir: /projects/che-sidecar-kubernetes-tooling
type: exec
command: |
read -p "Container Registry: " REGISTRY &&
echo -n $REGISTRY > $HOME/.docker/registry &&
read -p "User: " USER &&
echo -n $USER > $HOME/.docker/user &&
read -s -p "Password: " PASSWORD &&
echo -e "\nGenerating \e[93m$HOME/.docker/config.json\e[0m..." &&
auth=`echo -n $USER:$PASSWORD | base64` &&
echo -e '{"auths": {"'$REGISTRY'": {"auth": "'$auth'"}}}' > $HOME/.docker/config.json &&
echo -e "\e[32mDone.\e[0m"
component: buildkit-dev
#
# Builds image with Kubernetes plugin
#
- name: '1.2 Build and Push the image'
actions:
- workdir: /projects/che-sidecar-kubernetes-tooling
type: exec
command: |
REGISTRY=`cat $HOME/.docker/registry`
USER=`cat $HOME/.docker/user`
IMAGE=$REGISTRY/$USER/che-sidecar-kubernetes-tooling:dev-buildkit
echo -e "Building \e[93m$IMAGE\e[0m..."
buildctl-daemonless.sh build \
--frontend=dockerfile.v0 \
--local context=. \
--local dockerfile=. \
--output type=image,name=$IMAGE,push=true &&
echo -e "\e[32mDone.\e[0m"
component: buildkit-dev