How To Build an Alpine-based Virgo 3.7.0.RELEASE Container

A few weeks ago Virgo 3.7.0.RELEASE has been shipped.

Let's give it a try:

We start with an interactive Alpine Linux base openjdk image (at the time of writing openjdk:8u121-jre-alpine):

$ docker run -it --rm openjdk:8u121-jre-alpine /bin/sh

Install curl and bsdtar into the Java Alpine Linux container:

/ # apk update
/ # apk add curl libarchive-tools

Create the destination user and directory then grab version 3.7.0.RELEASE from Virgo Releases:

/ # adduser -D virgo
/ # su virgo
/ $ curl -L '' | bsdtar --strip-components 1 -C /home/virgo -xzf -

Since Virgo startup scripts depend on bash we need to add the shell before we can run Virgo:

/ # apk add bash

/ $ chmod u+x /home/virgo/bin/*sh
/ $ /home/virgo/bin/
[2017-04-07 18:53:51.772] sync Event Dispatcher Thread <UR0001I> User region ready.
[2017-04-07 18:53:51.824] startup-readiness            <KE0007I> Virgo ready. Started for 22.449s.

Looks good.

This interactive experiment results in the following basic Dockerfile:

FROM 8u121-jre-alpine

RUN apk update
RUN apk add curl libarchive-tools
RUN apk add bash

RUN adduser -D virgo
RUN curl -L

RUN chmod u+x /home/virgo/bin/*sh
RUN chown -R virgo:virgo /home/virgo


USER virgo
CMD ["/home/virgo/bin/"]

Have fun with your dockerized Virgo...

Show Comments