-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker container builder/publish for Airlift
See airbase-docker/README.md for details
- Loading branch information
Showing
5 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Airlift Docker Builder | ||
|
||
For modules that contain a file named `.build-airlift-docker`, | ||
the Maven properties below are used to generate a docker image during the | ||
package phase and to deploy/push that image during the delpoy phase. This | ||
[docker file](../airbase-docker/src/main/resources/AirliftDockerfile) is | ||
used to build the image. | ||
|
||
Note: modules must also contain `.build-airlift` so that the Airlift | ||
launcher tarball is generated. The Maven build will fail if this file | ||
is missing. | ||
|
||
## Maven Properties | ||
|
||
| Name | Default Value | Details | | ||
| ----- | ------------- | ------- | | ||
| air.docker.skip | false | skip all docker executions | | ||
| air.docker.skip-build | false | skip docker build | | ||
| air.docker.skip-deploy | false | skip docker deploy | | ||
| air.docker.skip-tag | false | skip docker tagging | | ||
| air.docker.verbose | false | enable verbose mode for dockerfile-maven-plugin | | ||
| air.docker.repository | ${project.groupId}/${project.artifactId} | Docker repo image name | | ||
| air.docker.application-name | ${project.artifactId} | `APPLICATION_NAME` in [AirliftDockerfile](../airbase-docker/src/main/resources/AirliftDockerfile) | | ||
| air.docker.maintainer | ${project.groupId} | `MAINTAINER` in [AirliftDockerfile](../airbase-docker/src/main/resources/AirliftDockerfile) | | ||
| air.docker.user | airlift | `USER` in [AirliftDockerfile](../airbase-docker/src/main/resources/AirliftDockerfile) | | ||
| air.docker.jdk | openjdk:${project.build.targetJdk}-jdk | `JAVA_VERSION` in [AirliftDockerfile](../airbase-docker/src/main/resources/AirliftDockerfile) | | ||
| air.docker.port | 8080 | `APPLICATION_PORT` in [AirliftDockerfile](../airbase-docker/src/main/resources/AirliftDockerfile) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.airlift</groupId> | ||
<artifactId>airbase-root</artifactId> | ||
<version>113-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>airbase-docker</artifactId> | ||
|
||
<description>Docker file for Airbase</description> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
ARG ARTIFACT_ID | ||
ARG ARTIFACT_VERSION | ||
ARG APPLICATION_NAME | ||
ARG JAVA_VERSION | ||
ARG MAINTAINER | ||
ARG USER | ||
ARG APPLICATION_PORT | ||
|
||
FROM alpine:3 as extractor | ||
|
||
ARG ARTIFACT_ID | ||
ARG ARTIFACT_VERSION | ||
ARG APPLICATION_NAME | ||
ARG JAVA_VERSION | ||
ARG MAINTAINER | ||
ARG USER | ||
ARG APPLICATION_PORT | ||
|
||
ADD ${ARTIFACT_ID}-${ARTIFACT_VERSION}.tar.gz /opt/${APPLICATION_NAME} | ||
RUN ln -s "${ARTIFACT_ID}-${ARTIFACT_VERSION}" /opt/${APPLICATION_NAME}/${ARTIFACT_ID} | ||
|
||
FROM ${JAVA_VERSION} | ||
|
||
ARG ARTIFACT_ID | ||
ARG ARTIFACT_VERSION | ||
ARG APPLICATION_NAME | ||
ARG JAVA_VERSION=11-jdk | ||
ARG MAINTAINER | ||
ARG USER | ||
ARG APPLICATION_PORT | ||
|
||
LABEL maintainer=${MAINTAINER} | ||
LABEL service=${ARTIFACT_ID} version=${ARTIFACT_VERSION} | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
jq \ | ||
python \ | ||
tmux && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
adduser --home /opt/${APPLICATION_NAME}/${ARTIFACT_ID} --no-create-home --disabled-login --gecos "" ${USER} && \ | ||
mkdir /var/log/${APPLICATION_NAME} && \ | ||
chown -R ${USER}:${USER} /var/log/${APPLICATION_NAME} | ||
|
||
COPY --chown=${USER}:${USER} --from=extractor /opt/${APPLICATION_NAME} /opt/${APPLICATION_NAME} | ||
|
||
EXPOSE ${APPLICATION_PORT} | ||
|
||
ENV APPLICATION_NAME=${APPLICATION_NAME} | ||
ENV ARTIFACT_ID=${ARTIFACT_ID} | ||
|
||
CMD /opt/${APPLICATION_NAME}/${ARTIFACT_ID}/bin/launcher run \ | ||
--etc-dir=/etc/${APPLICATION_NAME} \ | ||
--verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters