diff --git a/.github/workflows/container-images.yml b/.github/workflows/container-images.yml index 426b64a..269ae0c 100644 --- a/.github/workflows/container-images.yml +++ b/.github/workflows/container-images.yml @@ -21,8 +21,15 @@ jobs: strategy: matrix: image: + - function-data-buffer - function-generic-noop - function-generic-sleep + - function-media-encode + - function-media-generate-testpattern + - function-media-merge + - function-media-metadata-technical + - function-media-package-hls + - function-script-lua - gateway-nbmp - workflow-manager - workflow-manager-helper diff --git a/Makefile b/Makefile index 1d40622..8776e26 100644 --- a/Makefile +++ b/Makefile @@ -203,8 +203,15 @@ clean: ## Cleanup build output .PHONY: image image: $(addprefix image-, $(IMAGES)) ## Build all container images +## image-function-data-buffer: ## Build data-buffer function container image ## image-function-generic-noop: ## Build generic-noop function container image ## image-function-generic-sleep: ## Build generic-sleep function container image +## image-function-media-encode: ## Build media-encode function container image +## image-function-media-generate-testpattern: ## Build media-generate-testpattern function container image +## image-function-media-merge: ## Build media-merge function container image +## image-function-media-metadata-technical: ## Build media-metadata-technical function container image +## image-function-media-package-hls: ## Build media-package-hls function container image +## image-function-script-lua: ## Build script-lua function container image ## image-gateway-nbmp: ## Build NBMP gateway container image ## image-workflow-manager: ## Build workflow manager container image ## image-workflow-manager-helper: ## Build workflow manager helper container image diff --git a/build/package/image/function-data-buffer/Dockerfile.generic.generic b/build/package/image/function-data-buffer/Dockerfile.generic.generic new file mode 100644 index 0000000..bf60804 --- /dev/null +++ b/build/package/image/function-data-buffer/Dockerfile.generic.generic @@ -0,0 +1,93 @@ +# syntax=docker/dockerfile:1.4 + +ARG GOVERSION +FROM --platform=${BUILDPLATFORM} docker.io/library/golang:${GOVERSION} AS build + +ARG SKAFFOLD_GO_GCFLAGS="" + +WORKDIR /app + +COPY go.mod go.sum ./ +RUN --mount=type=cache,target=/root/.cache/go-build \ + go mod download +COPY . . + +# BUILD_DATE changes ofter so move this section down to allow for caching +ARG TARGETOS \ + TARGETARCH \ + TARGETVARIANT \ + VERSION \ + GIT_COMMIT \ + GIT_TREE_STATE \ + BUILD_DATE + +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/go/pkg/mod \ + --mount=type=cache,target=/app/tmp,id=app-tmp-${TARGETARCH}-${TARGETVARIANT},sharing=locked \ + make build-task-shim \ + "OS=${TARGETOS}" \ + "ARCH=${TARGETARCH}" \ + "VERSION=${VERSION}" \ + "GIT_COMMIT=${GIT_COMMIT}" \ + "GIT_TREE_STATE=${GIT_TREE_STATE}" \ + "BUILD_DATE=${BUILD_DATE}" \ + && make build-functions \ + "OS=${TARGETOS}" \ + "ARCH=${TARGETARCH}" \ + "VERSION=${VERSION}" \ + "GIT_COMMIT=${GIT_COMMIT}" \ + "GIT_TREE_STATE=${GIT_TREE_STATE}" \ + "BUILD_DATE=${BUILD_DATE}" + +FROM gcr.io/distroless/static:latest +LABEL org.opencontainers.image.base.name="gcr.io/distroless/static:latest" + +ENV GOTRACEBACK=all + +ARG TARGETOS \ + TARGETARCH \ + VERSION \ + GIT_COMMIT \ + BUILD_DATE + +LABEL maintainer="Matthias Neugebauer " \ + org.opencontainers.image.created="${BUILD_DATE}" \ + org.opencontainers.image.authors="Matthias Neugebauer " \ + org.opencontainers.image.url="ghcr.io/nagare-media/engine/function-data-buffer" \ + org.opencontainers.image.documentation="https://nagare.media" \ + org.opencontainers.image.source="https://github.com/nagare-media/engine" \ + org.opencontainers.image.version="${VERSION}" \ + org.opencontainers.image.revision="${GIT_COMMIT}" \ + org.opencontainers.image.vendor="nagare media" \ + org.opencontainers.image.licenses="Apache-2.0" \ + org.opencontainers.image.title="nagare media engine" \ + org.opencontainers.image.description="nagare media engine — an open source modern cloud- and edge-native media workflow system running on Kubernetes" + +WORKDIR / +COPY --from=build "/app/bin/task-shim-${VERSION}-${TARGETOS}-${TARGETARCH}" /task-shim +COPY --from=build "/app/bin/functions-${VERSION}-${TARGETOS}-${TARGETARCH}" /data-buffer +USER 65532:65532 + +COPY <