Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
add annotations (#26)
Browse files Browse the repository at this point in the history
Signed-off-by: Ramkumar Chinchani <[email protected]>
  • Loading branch information
rchincha authored Sep 26, 2022
1 parent 32aa16f commit 72aa5c8
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 72 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
echo DISTRO=$DISTRO >> $GITHUB_ENV
DISTRO_REL=$(echo $x| awk '{print $2}')
echo DISTRO_REL=$DISTRO_REL >> $GITHUB_ENV
# build image tag
cat config.mk | sed /^#.*$/d | sed s/\?=/=/g | sed s/#.*$//g | egrep -v "COMMIT|MAKE|DISTRO" > config.vars
cat ./config.vars
source ./config.vars
Expand All @@ -60,11 +59,14 @@ jobs:
exit 1
fi
SHA=${{ github.sha }}
SHA=${SHA::7}
echo SHA=$SHA >> $GITHUB_ENV
echo IMAGE=${{ matrix.image }}-$DISTRO-${{ matrix.arch }} >> $GITHUB_ENV
IMAGE_TAG=$TAG-${SHA::7}
IMAGE_TAG=$TAG-${SHA}
echo IMAGE_TAG=$IMAGE_TAG
echo IMAGE_TAG=$IMAGE_TAG >> $GITHUB_ENV
echo DESCRIPTION="$(cat images/${{ matrix.image }}/README.md)" >> $GITHUB_ENV
echo LICENSES="$(cat images/${{ matrix.image }}/LICENSE.md)" >> $GITHUB_ENV
- name: Run zot container image with podman
run: |
wget -N https://raw.githubusercontent.com/project-zot/zot/main/examples/config-cve.json
Expand All @@ -76,7 +78,9 @@ jobs:
with:
file: images/${{ matrix.image }}/stacker.yaml
build-args: |
COMMIT=${{ github.sha }}
REVISION=${{ env.SHA }}
DESCRIPTION="${{ env.DESCRIPTION }}"
LICENSES="${{ env.LICENSES }}"
OS=${{ matrix.os }}
ARCH=${{ matrix.arch }}
DISTRO=${{ env.DISTRO }}
Expand Down Expand Up @@ -136,7 +140,6 @@ jobs:
echo DISTRO=$DISTRO >> $GITHUB_ENV
DISTRO_REL=$(echo $x| awk '{print $2}')
echo DISTRO_REL=$DISTRO_REL >> $GITHUB_ENV
# build image tag
cat config.mk | sed /^#.*$/d | sed s/\?=/=/g | sed s/#.*$//g | egrep -v "COMMIT|MAKE|DISTRO" > config.vars
cat ./config.vars
source ./config.vars
Expand All @@ -150,16 +153,21 @@ jobs:
exit 1
fi
SHA=${{ github.sha }}
SHA=${SHA::7}
echo SHA=$SHA >> $GITHUB_ENV
echo IMAGE=${{ matrix.image }}-$DISTRO-${{ matrix.arch }} >> $GITHUB_ENV
IMAGE_TAG=$TAG
echo IMAGE_TAG=$IMAGE_TAG >> $GITHUB_ENV
echo DESCRIPTION="$(cat images/${{ matrix.image }}/README.md)" >> $GITHUB_ENV
echo LICENSES="$(cat images/${{ matrix.image }}/LICENSE.md)" >> $GITHUB_ENV
- name: Publish container images to zothub.io
uses: project-stacker/stacker-build-push-action@main
with:
file: images/${{ matrix.image }}/stacker.yaml
build-args: |
COMMIT=${{ github.sha }}
REVISION=${{ env.SHA }}
DESCRIPTION="${{ env.DESCRIPTION }}"
LICENSES="${{ env.LICENSES }}"
OS=${{ matrix.os }}
ARCH=${{ matrix.arch }}
DISTRO=${{ env.DISTRO }}
Expand Down
4 changes: 3 additions & 1 deletion images/base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ all: $(IMAGES) test
.PHONY: %
%:
stacker build -f $*.yaml \
--substitute BUILD_ID=$(COMMIT) \
--substitute REVISION=$(COMMIT) \
--substitute LICENSES="$(shell cat LICENSE.md)" \
--substitute DESCRIPTION="$(shell cat README.md)" \
--substitute OS=$(OS) \
--substitute ARCH=$(ARCH) \
--substitute DISTRO=$(DISTRO) \
Expand Down
2 changes: 1 addition & 1 deletion images/base/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
**base** is a minimal glibc-based Linux system.
base is a minimal glibc-based Linux system
12 changes: 9 additions & 3 deletions images/base/stacker.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# "base" is an image that can be used to package binaries
# that require libc runtime

config:
prerequisites:
- ../static/stacker.yaml
Expand Down Expand Up @@ -32,3 +29,12 @@ base-${{DISTRO}}-${{ARCH}}:
from:
type: tar
url: stacker://build-base/rootfs.tar
annotations:
org.opencontainers.image.title: base-${{DISTRO}}-${{ARCH}}
org.opencontainers.image.description: ${{DESCRIPTION}}
org.opencontainers.image.url: https://github.com/project-stacker/c3
org.opencontainers.image.source: https://github.com/project-stacker/c3
org.opencontainers.image.version: ${{DISTRO_REL}}
org.opencontainers.image.revision: ${{REVISION}}
org.opencontainers.image.licenses: ${{LICENSES}}
org.opencontainers.image.vendor: Cisco Systems, Inc.
40 changes: 0 additions & 40 deletions images/busybox/stacker.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion images/devel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ all: $(IMAGES) test
.PHONY: %
%:
stacker build -f $*.yaml \
--substitute BUILD_ID=$(COMMIT) \
--substitute REVISION=$(COMMIT) \
--substitute LICENSES="$(shell cat LICENSE.md)" \
--substitute DESCRIPTION="$(shell cat README.md)" \
--substitute OS=$(OS) \
--substitute ARCH=$(ARCH) \
--substitute DISTRO=$(DISTRO) \
Expand Down
2 changes: 1 addition & 1 deletion images/devel/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
**devel** is a layer which contains common packages use to compile and build programs.
devel is a layer which contains common packages use to compile and build programs.
6 changes: 4 additions & 2 deletions images/go-devel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ all: $(IMAGES) test

.PHONY: %
%:
stacker build -f $*.yaml \
--substitute BUILD_ID=$(COMMIT) \
stacker --debug build -f $*.yaml \
--substitute REVISION=$(COMMIT) \
--substitute LICENSES="$(shell cat LICENSE.md)" \
--substitute DESCRIPTION="$(shell cat README.md)" \
--substitute OS=$(OS) \
--substitute ARCH=$(ARCH) \
--substitute DISTRO=$(DISTRO) \
Expand Down
2 changes: 1 addition & 1 deletion images/go-devel/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
**golang-devel** is an image which contains a golang toolchain along with some common build tools.
golang-devel is an image which contains a golang toolchain along with some common build tools
11 changes: 9 additions & 2 deletions images/go-devel/stacker.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# "go-devel" is an image that can be used to do golang development

config:
prerequisites:
- ../static/stacker.yaml
Expand Down Expand Up @@ -72,6 +70,15 @@ go-devel-${{DISTRO}}-${{ARCH}}:
echo 'mkdir -p /tmp/go/cache' >> /etc/profile
echo 'export GOCACHE=/tmp/go/cache' >> /etc/profile
full_command: "/bin/sh -l"
annotations:
org.opencontainers.image.title: go-devel-${{DISTRO}}-${{ARCH}}
org.opencontainers.image.description: ${{DESCRIPTION}}
org.opencontainers.image.url: https://github.com/project-stacker/c3
org.opencontainers.image.source: https://github.com/project-stacker/c3
org.opencontainers.image.version: ${{GOLANG}}
org.opencontainers.image.revision: ${{REVISION}}
org.opencontainers.image.licenses: ${{LICENSES}}
org.opencontainers.image.vendor: Cisco Systems, Inc.

test-go-devel:
from:
Expand Down
4 changes: 3 additions & 1 deletion images/openj9-devel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ all: $(IMAGES) test
.PHONY: %
%:
stacker build -f $*.yaml \
--substitute BUILD_ID=$(COMMIT) \
--substitute REVISION=$(COMMIT) \
--substitute LICENSES="$(shell cat LICENSE.md)" \
--substitute DESCRIPTION="$(shell cat README.md)" \
--substitute OS=$(OS) \
--substitute ARCH=$(ARCH) \
--substitute DISTRO=$(DISTRO) \
Expand Down
2 changes: 1 addition & 1 deletion images/openj9-devel/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
**openj9-devel** is an image which contains IBM Semeru Runtime OpenJ9 JDK and JRE along with some common build tools.
openj9-devel is an image which contains IBM Semeru Runtime OpenJ9 JDK and JRE along with some common build tools
13 changes: 10 additions & 3 deletions images/openj9-devel/stacker.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# "openj9-devel" is an image that can be used to do Java development

config:
prerequisites:
- ../static/stacker.yaml
Expand Down Expand Up @@ -58,9 +56,18 @@ openj9-devel-${{DISTRO}}-${{ARCH}}:
url: stacker://build-openj9-devel/rootfs.tar
run: |
echo 'export HOME=/jdk' > /etc/profile
echo 'export JAVA_HOME=/opt/jdk' > /etc/profile
echo 'export JAVA_HOME=/opt/jdk' >> /etc/profile
echo 'export PATH=$JAVA_HOME/bin:$PATH' >> /etc/profile
full_command: "/bin/sh -l"
annotations:
org.opencontainers.image.title: openj9-devel-${{DISTRO}}-${{ARCH}}
org.opencontainers.image.description: ${{DESCRIPTION}}
org.opencontainers.image.url: https://github.com/project-stacker/c3
org.opencontainers.image.source: https://github.com/project-stacker/c3
org.opencontainers.image.version: ${{OPENJDK}}
org.opencontainers.image.revision: ${{REVISION}}
org.opencontainers.image.licenses: ${{LICENSES}}
org.opencontainers.image.vendor: Cisco Systems, Inc.

test-openj9-devel:
from:
Expand Down
4 changes: 3 additions & 1 deletion images/openj9/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ all: $(IMAGES) test
.PHONY: %
%:
stacker build -f $*.yaml \
--substitute BUILD_ID=$(COMMIT) \
--substitute REVISION=$(COMMIT) \
--substitute LICENSES="$(shell cat LICENSE.md)" \
--substitute DESCRIPTION="$(shell cat README.md)" \
--substitute OS=$(OS) \
--substitute ARCH=$(ARCH) \
--substitute DISTRO=$(DISTRO) \
Expand Down
2 changes: 1 addition & 1 deletion images/openj9/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
**openj9** is an image which contains IBM Semeru Runtime OpenJ9 JVM runtime to host Java applications.
openj9 is an image which contains IBM Semeru Runtime OpenJ9 JVM runtime to host Java applications
13 changes: 10 additions & 3 deletions images/openj9/stacker.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# "openj9-devel" is an image that can be used to do Java development

config:
prerequisites:
- ../static/stacker.yaml
Expand Down Expand Up @@ -59,9 +57,18 @@ openj9-${{DISTRO}}-${{ARCH}}:
url: stacker://build-openj9/rootfs.tar
run: |
echo 'export HOME=/jre' > /etc/profile
echo 'export JAVA_HOME=/opt/jre' > /etc/profile
echo 'export JAVA_HOME=/opt/jre' >> /etc/profile
echo 'export PATH=$JAVA_HOME/bin:$PATH' >> /etc/profile
full_command: "/bin/sh -l"
annotations:
org.opencontainers.image.title: openj9-${{DISTRO}}-${{ARCH}}
org.opencontainers.image.description: ${{DESCRIPTION}}
org.opencontainers.image.url: https://github.com/project-stacker/c3
org.opencontainers.image.source: https://github.com/project-stacker/c3
org.opencontainers.image.version: ${{OPENJDK}}
org.opencontainers.image.revision: ${{REVISION}}
org.opencontainers.image.licenses: ${{LICENSES}}
org.opencontainers.image.vendor: Cisco Systems, Inc.

run-openj9:
from:
Expand Down
4 changes: 3 additions & 1 deletion images/static/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ all: $(IMAGES) test
.PHONY: %
%:
stacker build -f $*.yaml \
--substitute BUILD_ID=$(COMMIT) \
--substitute REVISION=$(COMMIT) \
--substitute LICENSES="$(shell cat LICENSE.md)" \
--substitute DESCRIPTION="$(shell cat README.md)" \
--substitute OS=$(OS) \
--substitute ARCH=$(ARCH) \
--substitute DISTRO=$(DISTRO) \
Expand Down
2 changes: 1 addition & 1 deletion images/static/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
**static** is a minimal Linux system intended for use directly by statically compiled binaries.
static is a minimal Linux system intended for use directly by statically compiled binaries
12 changes: 9 additions & 3 deletions images/static/stacker.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# "static" is an image that can be used to
# package statically built binaries (go, rust, etc)

build-static:
from:
type: docker
Expand All @@ -25,3 +22,12 @@ static-${{DISTRO}}-${{ARCH}}:
from:
type: tar
url: stacker://build-static/rootfs.tar
annotations:
org.opencontainers.image.title: static-${{DISTRO}}-${{ARCH}}
org.opencontainers.image.description: ${{DESCRIPTION}}
org.opencontainers.image.url: https://github.com/project-stacker/c3
org.opencontainers.image.source: https://github.com/project-stacker/c3
org.opencontainers.image.version: ${{DISTRO_REL}}
org.opencontainers.image.revision: ${{REVISION}}
org.opencontainers.image.licenses: ${{LICENSES}}
org.opencontainers.image.vendor: Cisco Systems, Inc.

0 comments on commit 72aa5c8

Please sign in to comment.