Skip to content

Commit

Permalink
docker image tagging options
Browse files Browse the repository at this point in the history
separate alpine base image from the default image and add more tagging options
  • Loading branch information
vordimous committed Sep 28, 2023
1 parent d8dd58b commit 4bf7f95
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 9 deletions.
5 changes: 3 additions & 2 deletions cloud/docker-image/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,12 @@
<images>
<image>
<alias>zilla</alias>
<name>ghcr.io/aklivity/zilla:%v</name>
<name>ghcr.io/aklivity/zilla</name>
<build>
<contextDir>${docker.context}</contextDir>
<tags>
<tag>latest</tag>
<tag>${project.version}${docker.tagSuffix}</tag>
<tag>${docker.tagAlt}</tag>
</tags>
<buildx>
<platforms>
Expand Down
36 changes: 36 additions & 0 deletions cloud/docker-image/src/main/docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright 2021-2023 Aklivity Inc
#
# Licensed under the Aklivity Community License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
# https://www.aklivity.io/aklivity-community-license/
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#

FROM eclipse-temurin:20-alpine AS build

COPY maven /root/.m2/repository

COPY zpmw zpmw
COPY zpm.json.template zpm.json.template

RUN apk add --no-cache gettext
RUN cat zpm.json.template | env VERSION=${project.version} envsubst > zpm.json

RUN apk add --no-cache wget
RUN ./zpmw install --debug --exclude-remote-repositories
RUN ./zpmw clean --keep-image

FROM alpine:3.18.3

COPY --from=build /.zpm /opt/zilla/.zpm
COPY --from=build /zilla /opt/zilla/zilla
COPY zilla.properties /opt/zilla/.zilla/zilla.properties

ENTRYPOINT ["/opt/zilla/zilla"]
2 changes: 2 additions & 0 deletions cloud/docker-image/src/main/docker/alpine/zilla.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
zilla.engine.config.url=file:/etc/zilla/zilla.yaml
zilla.engine.directory=/var/run/zilla
47 changes: 47 additions & 0 deletions cloud/docker-image/src/main/docker/alpine/zpm.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"repositories":
[
"https://maven.packages.aklivity.io/",
"https://repo.maven.apache.org/maven2/"
],

"imports":
[
"io.aklivity.zilla:runtime:${VERSION}"
],

"dependencies":
[
"io.aklivity.zilla:binding-echo",
"io.aklivity.zilla:binding-fan",
"io.aklivity.zilla:binding-filesystem",
"io.aklivity.zilla:binding-http",
"io.aklivity.zilla:binding-http-filesystem",
"io.aklivity.zilla:binding-http-kafka",
"io.aklivity.zilla:binding-grpc",
"io.aklivity.zilla:binding-grpc-kafka",
"io.aklivity.zilla:binding-kafka-grpc",
"io.aklivity.zilla:binding-kafka",
"io.aklivity.zilla:binding-mqtt",
"io.aklivity.zilla:binding-mqtt-kafka",
"io.aklivity.zilla:binding-proxy",
"io.aklivity.zilla:binding-sse",
"io.aklivity.zilla:binding-sse-kafka",
"io.aklivity.zilla:binding-tcp",
"io.aklivity.zilla:binding-tls",
"io.aklivity.zilla:binding-ws",
"io.aklivity.zilla:command",
"io.aklivity.zilla:command-metrics",
"io.aklivity.zilla:command-start",
"io.aklivity.zilla:command-stop",
"io.aklivity.zilla:engine",
"io.aklivity.zilla:exporter-prometheus",
"io.aklivity.zilla:guard-jwt",
"io.aklivity.zilla:metrics-stream",
"io.aklivity.zilla:metrics-http",
"io.aklivity.zilla:metrics-grpc",
"io.aklivity.zilla:vault-filesystem",
"org.slf4j:slf4j-simple",
"org.antlr:antlr4-runtime"
]
}
8 changes: 3 additions & 5 deletions cloud/docker-image/src/main/docker/release/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
# specific language governing permissions and limitations under the License.
#

FROM eclipse-temurin:20-alpine AS build
FROM eclipse-temurin:20-jdk AS build

RUN apk add --no-cache \
gettext \
wget
RUN apt update && apt install -y gettext

COPY maven /root/.m2/repository

Expand All @@ -29,7 +27,7 @@ RUN cat zpm.json.template | env VERSION=${project.version} envsubst > zpm.json
RUN ./zpmw install --debug --exclude-remote-repositories
RUN ./zpmw clean --keep-image

FROM alpine:3.18.3
FROM ubuntu:jammy

LABEL maintainer="Aklivity Docker Maintainers <support@aklivity.io>"
ENV ZILLA_VERSION ${project.version}
Expand Down
82 changes: 80 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,9 @@

<properties>
<docker.context>incubator</docker.context>
<docker.platforms>linux/x86_64</docker.platforms>
<docker.platforms>linux/x86_64,linux/arm64</docker.platforms>
<docker.tagSuffix>-rc</docker.tagSuffix>
<docker.tagAlt>local</docker.tagAlt>
<docker.skip.push>true</docker.skip.push>
<docker.skip.tag>true</docker.skip.tag>
</properties>
Expand Down Expand Up @@ -615,6 +617,81 @@
</modules>
</profile>

<profile>
<id>alpine</id>
<activation>
<property>
<name>release</name>
<value>true</value>
</property>
</activation>

<distributionManagement>
<downloadUrl>https://maven.pkg.github.com/aklivity/zilla/</downloadUrl>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/aklivity/zilla/</url>
</repository>
<snapshotRepository>
<id>github</id>
<url>https://maven.pkg.github.com/aklivity/zilla/</url>
</snapshotRepository>
</distributionManagement>

<properties>
<docker.context>alpine</docker.context>
<docker.platforms>linux/x86_64</docker.platforms>
<docker.tagSuffix>-alpine</docker.tagSuffix>
<docker.tagAlt>alpine</docker.tagAlt>
<docker.skip.push>false</docker.skip.push>
<docker.skip.tag>false</docker.skip.tag>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-no-snapshots</id>
<phase>validate</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireReleaseDeps>
<message>No Snapshots Allowed!</message>
</requireReleaseDeps>
<requireJavaVersion>
<version>[13,14)</version>
</requireJavaVersion>
<requireProperty>
<property>release</property>
<regex>true</regex>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>release</id>
<activation>
Expand All @@ -638,7 +715,8 @@

<properties>
<docker.context>release</docker.context>
<docker.platforms>linux/x86_64</docker.platforms>
<docker.platforms>linux/x86_64,linux/arm64</docker.platforms>
<docker.tagAlt>latest</docker.tagAlt>
<docker.skip.push>false</docker.skip.push>
<docker.skip.tag>false</docker.skip.tag>
</properties>
Expand Down

0 comments on commit 4bf7f95

Please sign in to comment.