Skip to content

Commit a8d9f52

Browse files
committed
Pushing init image for k8s builder to work
Signed-off-by: asararatnakar <[email protected]>
1 parent 03d6f43 commit a8d9f52

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build Init image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
image:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Build and Push Init Image
14+
run: |
15+
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
16+
make init-image

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
#
1818

1919
IMAGE ?= ghcr.io/hyperledger-labs/fabric-operator
20+
INIT_IMAGE ?= ghcr.io/hyperledger-labs/init
2021
TAG ?= $(shell git rev-parse --short HEAD)
2122
ARCH ?= $(shell go env GOARCH)
2223
OSS_GO_VER ?= 1.17.7
2324
BUILD_DATE = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
2425
OS = $(shell go env GOOS)
26+
K8S_TAG = v0.6.0
2527

2628
DOCKER_IMAGE_REPO ?= ghcr.io
2729

@@ -47,6 +49,10 @@ image: setup
4749
docker build --rm . -f Dockerfile $(BUILD_ARGS) -t $(IMAGE):$(TAG)-$(ARCH)
4850
docker tag $(IMAGE):$(TAG)-$(ARCH) $(IMAGE):latest-$(ARCH)
4951

52+
init-image:
53+
docker build --rm . -f sample-network/init/Dockerfile --build-arg K8S_TAG=$(K8S_TAG) -t $(INIT_IMAGE):latest-$(ARCH)
54+
docker push $(INIT_IMAGE):latest-$(ARCH)
55+
5056
govendor:
5157
@go mod vendor
5258

sample-network/init/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ARG K8S_TAG
2+
FROM ghcr.io/hyperledgendary/k8s-fabric-peer:${K8S_TAG} as builder
3+
4+
FROM registry.access.redhat.com/ubi8/ubi-minimal
5+
6+
RUN microdnf update \
7+
&& microdnf install -y \
8+
shadow-utils \
9+
iputils \
10+
tar \
11+
&& groupadd -g 7051 ibp-user \
12+
&& useradd -u 7051 -g ibp-user -s /bin/bash ibp-user \
13+
&& microdnf remove shadow-utils \
14+
&& microdnf clean all \
15+
&& mkdir -p /opt/hyperledger/k8s_builder/bin;
16+
17+
COPY --from=builder /opt/hyperledger/k8s_builder/bin/ /opt/hyperledger/k8s_builder/bin/

0 commit comments

Comments
 (0)