Features/oci image #157
37
.github/workflows/build-oci.yaml
vendored
Normal file
37
.github/workflows/build-oci.yaml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: Build OCI image
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Log in to the Container registry
|
||||||
|
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./oci/katenary/Containerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
build-args: |
|
||||||
|
VERSION=${{github.ref_name}}
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -30,3 +30,4 @@ __pycache__
|
|||||||
# local binaries
|
# local binaries
|
||||||
katenary
|
katenary
|
||||||
!cmd/katenary
|
!cmd/katenary
|
||||||
|
!oci/katenary
|
||||||
|
@@ -186,7 +186,7 @@ services:
|
|||||||
database:
|
database:
|
||||||
image: mariadb:10
|
image: mariadb:10
|
||||||
env_file:
|
env_file:
|
||||||
# this valuse will be added in a configMap
|
# this values will be added in a configMap
|
||||||
- my_env.env
|
- my_env.env
|
||||||
environment:
|
environment:
|
||||||
MARIADB_USER: foo
|
MARIADB_USER: foo
|
||||||
|
@@ -4,3 +4,6 @@ MD022: false
|
|||||||
MD033: false
|
MD033: false
|
||||||
MD041: false
|
MD041: false
|
||||||
MD046: false
|
MD046: false
|
||||||
|
# list indentation
|
||||||
|
MD007:
|
||||||
|
indent: 4
|
||||||
|
@@ -3,14 +3,14 @@
|
|||||||
Katenary uses `compose-go` and several Kubernetes official packages.
|
Katenary uses `compose-go` and several Kubernetes official packages.
|
||||||
|
|
||||||
- `github.com/compose-spec/compose-go`: to parse compose files. It ensures :
|
- `github.com/compose-spec/compose-go`: to parse compose files. It ensures :
|
||||||
- that the project respects the "compose" specification
|
- that the project respects the "compose" specification
|
||||||
- that Katenary uses the "compose" struct exactly the same way `podman compose` or `docker copose` does
|
- that Katenary uses the "compose" struct exactly the same way `podman compose` or `docker compose` does
|
||||||
- `github.com/spf13/cobra`: to parse command line arguments, sub-commands and flags. It also generates completion for
|
- `github.com/spf13/cobra`: to parse command line arguments, sub-commands and flags. It also generates completion for
|
||||||
bash, zsh, fish and PowerShell.
|
bash, zsh, fish and PowerShell.
|
||||||
- `github.com/thediveo/netdb`: to get the standard names of a service from its port number
|
- `github.com/thediveo/netdb`: to get the standard names of a service from its port number
|
||||||
- `gopkg.in/yaml.v3`:
|
- `gopkg.in/yaml.v3`:
|
||||||
- to generate `Chart.yaml` and `values.yaml` files (only)
|
- to generate `Chart.yaml` and `values.yaml` files (only)
|
||||||
- to parse Katenary labels in the compose file
|
- to parse Katenary labels in the compose file
|
||||||
- `k8s.io/api` and `k8s.io/apimachinery` to create Kubernetes objects
|
- `k8s.io/api` and `k8s.io/apimachinery` to create Kubernetes objects
|
||||||
- `sigs.k8s.io/yaml`: to generate Katenary YAML files in the format of Kubernetes objects
|
- `sigs.k8s.io/yaml`: to generate Katenary YAML files in the format of Kubernetes objects
|
||||||
|
|
||||||
|
15
oci/katenary/Containerfile
Normal file
15
oci/katenary/Containerfile
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
ARG GOVERSION=1.24
|
||||||
|
|
||||||
|
FROM docker.io/golang:${GOVERSION} AS builder
|
||||||
|
ARG VERSION=master
|
||||||
|
RUN set -xe; \
|
||||||
|
CGO_ENABLED=0 go install -v github.com/katenary/katenary/cmd/katenary@$VERSION;
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
LABEL org.opencontainers.image.source=https://github.com/katenary/katenary
|
||||||
|
LABEL org.opencontainers.image.description="Katenary converts compose files to Helm Chart"
|
||||||
|
LABEL org.opencontainers.image.licenses=MIT
|
||||||
|
COPY --from=builder /go/bin/katenary /usr/local/bin/katenary
|
||||||
|
VOLUME /project
|
||||||
|
WORKDIR /project
|
||||||
|
ENTRYPOINT ["/usr/local/bin/katenary"]
|
Reference in New Issue
Block a user