Skip to content
Permalink
Browse files
add support for specifying dropins
and tweak arg names
  • Loading branch information
ahgittin committed Nov 8, 2016
1 parent 15cd83f commit 53119381e0561bf63efe08300189945426feeba8
Showing 4 changed files with 29 additions and 11 deletions.
@@ -21,7 +21,7 @@
FROM openjdk:8-jre-alpine
MAINTAINER Alex Heneveld "alex@cloudsoft.io"

RUN apk add --update --no-cache bash openssh ; \
RUN apk add --update --no-cache bash openssh wget ; \
mv /dev/random /dev/random-real && ln -s /dev/urandom /dev/random
RUN adduser -D brooklyn
WORKDIR /home/brooklyn
@@ -40,17 +40,25 @@ USER brooklyn

# handle customisation, including passing args through to the container script and installing boms
ARG application
ARG install_bom
ARG install_boms
ARG dropins_jars
RUN \
if [ -n "${debug}" ] ; then echo debug=true >> brooklyn-docker-start.opts ; fi ; \
if [ -n "${application}" ] ; then echo application=${application} >> brooklyn-docker-start.opts ; fi ; \
if [ -n "${install_bom}" ] ; then \
if [ -n "${install_boms}" ] ; then \
echo "brooklyn.catalog:" > conf/brooklyn/default.catalog.bom ; \
echo " items:" >> conf/brooklyn/default.catalog.bom ; \
for x in ${install_bom} ; do \
for x in ${install_boms} ; do \
echo Installing $x to catalog ; \
echo " - "$x >> conf/brooklyn/default.catalog.bom ; \
done \
done ; \
fi ; \
if [ -n "${dropins_jars}" ] ; then \
cd lib/dropins/ ; \
for x in ${dropins_jars} ; do \
echo Download $x to lib/dropins ; \
wget -q --trust-server-names $x ; \
done ; \
fi

# and start
@@ -55,20 +55,29 @@ USER brooklyn

# handle customisation, including passing args through to the container script and installing boms
ARG application
ARG install_bom
ARG install_boms
ARG dropins_jars
RUN \
if [ -n "${debug}" ] ; then echo debug=true >> brooklyn-docker-start.opts ; fi ; \
if [ -n "${application}" ] ; then echo application=${application} >> brooklyn-docker-start.opts ; fi ; \
if [ -n "${install_bom}" ] ; then \
if [ -n "${install_boms}" ] ; then \
echo "brooklyn.catalog:" > conf/brooklyn/default.catalog.bom ; \
echo " items:" >> conf/brooklyn/default.catalog.bom ; \
for x in ${install_bom} ; do \
for x in ${install_boms} ; do \
echo Installing $x to catalog ; \
echo " - "$x >> conf/brooklyn/default.catalog.bom ; \
done \
done ; \
fi ; \
if [ -n "${dropins_jars}" ] ; then \
cd lib/dropins/ ; \
for x in ${dropins_jars} ; do \
echo Download $x to lib/dropins ; \
wget -q --trust-server-names $x ; \
done ; \
fi

# and start
EXPOSE 8081
ENTRYPOINT ["bin/brooklyn-docker-start"]
CMD []

@@ -55,7 +55,7 @@ run-shell:

example-image-hyperledger: prep
docker build -t brooklyncentral/brooklyn-hyperledger \
--build-arg install_bom="https://raw.githubusercontent.com/cloudsoft/brooklyn-hyperledger/master/docker.bom https://raw.githubusercontent.com/cloudsoft/brooklyn-hyperledger/master/catalog.bom" \
--build-arg install_boms="https://raw.githubusercontent.com/cloudsoft/brooklyn-hyperledger/master/docker.bom https://raw.githubusercontent.com/cloudsoft/brooklyn-hyperledger/master/catalog.bom" \
--build-arg application=hyperledger-fabric-single-cluster-application \
.

@@ -8,7 +8,8 @@ When building, you can use:

* `--build-arg debug=true` to install extra tools on the VM and show debug output from our script when booting the container
* `--build-arg application=my-app` to create a container which boots `my-app` by default
* `--build-arg install_bom="http://path/to/file.bom http://path/to/another.bom"` to replace the default catalog with one or more BOM files (useful with `application` above)
* `--build-arg install_boms="http://path/to/file.bom http://path/to/another.bom"` to replace the default catalog with one or more BOM files (useful with `application` above)
* `--build-arg dropins_jars="http://path/to/file.jar http://path/to/another.jar"` to add JARs in the dropins dir (useful with `application` and `install_boms` above)

See examples in the `Makefile`.

0 comments on commit 5311938

Please sign in to comment.