Skip to content

Commit

Permalink
Pushing init image for k8s builder to work
Browse files Browse the repository at this point in the history
Signed-off-by: asararatnakar <[email protected]>
  • Loading branch information
asararatnakar committed Oct 10, 2022
1 parent 03d6f43 commit f1df324
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/init-image-build-n-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build Init image

on:
push:
branches: [main]

jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Build and Push Init Image
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
make init-image
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
#

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

DOCKER_IMAGE_REPO ?= ghcr.io

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

init-image:
docker build --rm . -f sample-network/init/Dockerfile --build-arg K8S_TAG=$(K8S_TAG) -t $(INIT_IMAGE):latest-$(ARCH)
docker push $(INIT_IMAGE):latest-$(ARCH)

govendor:
@go mod vendor

Expand Down
17 changes: 17 additions & 0 deletions sample-network/init/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG K8S_TAG
FROM ghcr.io/hyperledgendary/k8s-fabric-peer:${K8S_TAG} as builder

FROM registry.access.redhat.com/ubi8/ubi-minimal

RUN microdnf update \
&& microdnf install -y \
shadow-utils \
iputils \
tar \
&& groupadd -g 7051 ibp-user \
&& useradd -u 7051 -g ibp-user -s /bin/bash ibp-user \
&& microdnf remove shadow-utils \
&& microdnf clean all \
&& mkdir -p /opt/hyperledger/k8s_builder/bin;

COPY --from=builder /opt/hyperledger/k8s_builder/bin/ /opt/hyperledger/k8s_builder/bin/

0 comments on commit f1df324

Please sign in to comment.