Skip to content

Commit

Permalink
Enable a docker plugin for build time image creation (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
John D. Ament committed Jan 16, 2018
1 parent 72e5306 commit 779fbd1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM openjdk:8u92-alpine

ARG JAR_FILE
ARG CONF_FILE
ARG PROP_FILE
ARG MYSQL_CONNECTOR_VERSION=5.0.8

RUN apk add --update bash curl unzip && \
rm -rf /var/cache/apk/*

# Install MySQL Connector
WORKDIR /opt/holdmail/lib
RUN curl -sLO https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-${MYSQL_CONNECTOR_VERSION}.zip && \
unzip mysql-connector-java-${MYSQL_CONNECTOR_VERSION}.zip

# Install Holdmail

RUN mkdir -p /var/log/holdmail

WORKDIR /etc
ADD ${PROP_FILE} holdmail.properties

WORKDIR /opt/holdmail/bin/
ADD ${JAR_FILE} holdmail.jar
ADD ${CONF_FILE} holdmail.conf

EXPOSE 8080 25000

ENTRYPOINT ["./holdmail.jar"]
12 changes: 11 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2016 - 2017 Sparta Systems, Inc
* Copyright 2016 - 2018 Sparta Systems, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,6 +28,7 @@ plugins {
id "com.github.jk1.dependency-license-report" version "0.4.1"
id "net.researchgate.release" version "2.5.0"
id "com.jfrog.bintray" version "1.7.3"
id "com.palantir.docker" version "0.17.2"
}


Expand All @@ -37,6 +38,8 @@ description = 'holdmail'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'

def dockerName = System.getProperty("dockerName", "sparta/holdmail")

dependencies {

compile 'org.springframework.boot:spring-boot-starter-data-jpa'
Expand Down Expand Up @@ -106,6 +109,7 @@ rat {
'README.md',
'CONTRIBUTING.md',
'RELEASE.md',
'Dockerfile',
'.github/*',
'docker/',
'src/main/resources/db/migration/*.sql',
Expand Down Expand Up @@ -139,6 +143,12 @@ jar {
from { ['LICENSE', 'NOTICE', "$projectDir/build/thirdparty-licenses"] }
}

docker {
name dockerName
files jar.archivePath, './docker/assets/etc/holdmail.properties', './docker/assets/opt/holdmail/bin/holdmail.conf'
buildArgs(['JAR_FILE': "${jar.archiveName}", 'PROP_FILE': 'holdmail.properties', 'CONF_FILE':'holdmail.conf'])
}

def RPM_INSTALL_DIR = '/opt/holdmail'
def RPM_USER = 'holdmail'
def RPM_GROUP = 'holdmail'
Expand Down
5 changes: 2 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# Copyright 2016 Sparta Systems, Inc
# Copyright 2016 - 2018 Sparta Systems, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,5 +17,4 @@
################################################################################


version=1.0.5-SNAPSHOT

version=2.0.0-SNAPSHOT

0 comments on commit 779fbd1

Please sign in to comment.