Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
FROM maven:3.5.2-jdk-8-alpine

# Install necessary binaries to build brooklyn-dist
RUN apk add --no-cache git rpm dpkg
RUN apk add --no-cache git rpm dpkg docker

# Make sure the /var/tmp (for RPM build) is writable for all users
RUN mkdir -p /var/tmp/ && chmod -R 777 /var/tmp/
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ node(label: 'ubuntu') {
}

stage('Run tests') {
environmentDockerImage.inside('-i --name brooklyn-${DOCKER_TAG} -v ${WORKSPACE}/.m2:/var/maven/.m2 --mount type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly -v ${WORKSPACE}:/usr/build -w /usr/build') {
sh 'mvn clean install -Prpm -Pdeb -Duser.home=/var/maven -Duser.name=jenkins'
environmentDockerImage.inside('-i --name brooklyn-${DOCKER_TAG} -v ${WORKSPACE}/.m2:/var/maven/.m2 --mount type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly -v /var/run/docker.sock:/var/run/docker.sock -v ${WORKSPACE}:/usr/build -w /usr/build') {
sh 'mvn clean install -Prpm -Pdeb -Pdocker -Duser.home=/var/maven -Duser.name=jenkins'
}
}
}
Expand Down
177 changes: 112 additions & 65 deletions docker-image/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,75 +20,122 @@
<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>
<modelVersion>4.0.0</modelVersion>

<artifactId>karaf-docker-image</artifactId>
<packaging>pom</packaging>
<name>Brooklyn Docker Image</name>
<artifactId>karaf-docker-image</artifactId>
<packaging>pom</packaging>
<name>Brooklyn Docker Image</name>

<parent>
<groupId>org.apache.brooklyn</groupId>
<artifactId>brooklyn-dist-root</artifactId>
<version>1.1.0-SNAPSHOT</version> <!-- BROOKLYN_VERSION -->
<relativePath>../pom.xml</relativePath>
</parent>
<parent>
<groupId>org.apache.brooklyn</groupId>
<artifactId>brooklyn-dist-root</artifactId>
<version>1.1.0-SNAPSHOT</version> <!-- BROOKLYN_VERSION -->
<relativePath>../pom.xml</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>org.apache.brooklyn</groupId>
<artifactId>apache-brooklyn</artifactId>
<version>${project.version}</version>
<type>tar.gz</type>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.apache.brooklyn</groupId>
<artifactId>apache-brooklyn</artifactId>
<version>${project.version}</version>
<type>tar.gz</type>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-distro</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.brooklyn</groupId>
<artifactId>apache-brooklyn</artifactId>
<type>tar.gz</type>
<outputDirectory>${project.build.directory}</outputDirectory>
<destFileName>apache-brooklyn-${project.version}.tar.gz</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile-maven-plugin.version}</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>apache/brooklyn</repository>
<tag>${project.version}</tag>
<buildArgs>
<DIST_TAR_GZ>target/apache-brooklyn-${project.version}.tar.gz</DIST_TAR_GZ>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>

<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-distro</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.brooklyn</groupId>
<artifactId>apache-brooklyn</artifactId>
<type>tar.gz</type>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<destFileName>apache-brooklyn-${project.version}.tar.gz</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<verbose>true</verbose>
<images>
<image>
<name>apache/brooklyn:%v</name>
<build>
<args>
<DIST_TAR_GZ>apache-brooklyn-${project.version}.tar.gz</DIST_TAR_GZ>
</args>
<contextDir>${project.build.outputDirectory}</contextDir>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>cleanup</id>
<phase>initialize</phase>
<goals>
<goal>remove</goal>
</goals>
</execution>
<execution>
<id>build</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<inherited>false</inherited>
<configuration>
<skipSource>true</skipSource>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

</project>

Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@

FROM openjdk:8-jre-alpine
LABEL maintainer="Brooklyn Team :: https://brooklyn.apache.org/"
EXPOSE 8081 8443

ARG DIST_TAR_GZ
COPY ${DIST_TAR_GZ} brooklyn.tar.gz
ENV EXTRA_JAVA_OPTS="-XX:SoftRefLRUPolicyMSPerMB=1 -Djava.security.egd=file:/dev/./urandom"

RUN apk --no-cache add bash ; \
mkdir brooklyn ; \
tar xzf brooklyn.tar.gz -C /brooklyn --strip-components 1 ;
mkdir -p /opt/brooklyn ; \
tar xzf brooklyn.tar.gz -C /opt/brooklyn --strip-components 1 ;

ENTRYPOINT ["/brooklyn/bin/karaf"]
ENTRYPOINT ["/opt/brooklyn/bin/karaf"]
CMD ["server"]

EXPOSE 8081 8443