On second thought, for minimal image and overhead would be best to hook it up together from these two images based on alpine linux:
But still lacking experience though. =)
It is far from perfect and minimal, but it works, Posting it here, so anybody can learn from it and possibly improve it.
It should work, if you copy TW installation files into tw directory and run docker-compose up in root folder. After some initial setup, you should be able to see TW instance on your localhost/thingworx port 80.
File here: ThingWorx setup for docker.
It was very chaotic, but generally you need to master docker commands and shell scripting. I have mostly read official docs and I highly recommend base image with pre installed apache or postgres. It it best to pick operating system you understand at least little bit (generally RedHat or Debian). For me it was debian.
So I have installed docker toolbox with kitematic and started playing around, eventually I was able to set up both systems manually. I used official images of apache and postgres both based on debian. Then I got to reading: Build your own images - Docker and got myself images with some level of automation. After that I started composing looking at Quickstart: Compose and WordPress - Docker. Finally I end up with this result...
There are definitely more articles and blog post I have read and dont remember, hope it helps!
Thanks for the working reference.
As I thought, you were working with a Postgres backed version of Thingworx and as an academic user, I don't have access to this version.
But as I wrote in another discussion, I did learn to build a simple working docker-compose file for the developer edition that is backed by the H2 database.
Just wanted to share my how to to build up a TW instance using docker.
Build an ubuntu server VM NIC bridged
sudo apt-get update
Install OpenSSH server
Back up sshconfig
sudo cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config_backup
Edit the config file to allow port 22
sudo nano /etc/ssh/ssh_config
uncomment Port 22
sudo service ssh restart
Get server IP
Log in from putty
wget -qO- http://get.docker.com | sh
Add your user to docker group
sudo usermod -aG docker (username)
Log back in with putty.
Configure your docker directory
mkdir (docker working dir)
cd /(docker working dir)
Add your war file and tomcat-users.xml to the build directory. "filezilla"
ENV CATALINA_HOME /usr/local/tomcat
ENV PATH $CATALINA_HOME/bin:$PATH
RUN mkdir -p "$CATALINA_HOME" \
&& mkdir -p "/ThingworxStorage" \
&& mkdir -p "/ThingworxBackupStorage"
# && chown tomcat8:tomcat8 /ThingworxStorage /ThingworxBackupStorage \
# && chown 755 /ThingworxStorage /ThingworxBackupStorage
# see https://www.apache.org/dist/tomcat/tomcat-8/KEYS
RUN gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys \
ENV TOMCAT_MAJOR 8
ENV TOMCAT_VERSION 8.0.37
ENV TOMCAT_TGZ_URL https://www.apache.org/dist/tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz
RUN curl -SL "$TOMCAT_TGZ_URL" -o tomcat.tar.gz \
&& curl -SL "$TOMCAT_TGZ_URL.asc" -o tomcat.tar.gz.asc \
&& gpg --verify tomcat.tar.gz.asc \
&& tar -xvf tomcat.tar.gz --strip-components=1 \
&& rm bin/*.bat \
&& rm tomcat.tar.gz*
ENV JAVA_OPTS -Dserver -Dd64 -Xms1024m -Xmx5g -XX:+UseNUMA -XX:+UseConcMarkSweepGC
ENV CATALINA_OPTS -Djava.net.preferIPv4Stack=true
COPY build/tomcat-users.xml $CATALINA_HOME/conf/
COPY build/Thingworx.war $CATALINA_HOME/webapps/
CMD ["catalina.sh", "run"]
docker build -t thingworx .
docker run -d -p 8080:8080 thingworx
Test connect to http://IP:8080/Thingworx
default account is Administrator/admin
You should use Docker shared volumes to get the TW storage directories (/ThingworxStorage and ThingworxBackupStorage) outside of the container. Example : docker run -d -p 8080:8080 -v $HOME/TW/ThingworxStorage:/ThingworxStorage -v $HOME/TW/ThingworxBackupStorage:/ThingworxBackupStorage thingworx