Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOTECH-2121: Creates a MOTECH docker image built using the DEB #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
11 changes: 6 additions & 5 deletions motech-centos/README
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
2. Copy to destination folder with Dockerfile and run.sh script:
* /motech/packaging/rpm/target/rpm/motech-base/RPMS/noarch/*.rpm (rename on motech-base.rpm)
* /motech/target/rpm/motech/RPMS/noarch/*.rpm (rename on motech.rpm)
3. sudo docker build -t motech/motech:centos ./detination_folder
3. sudo docker build -t motech/motech:centos ./destination_folder

#Starting motech from motech-centos image

4. Run image (sudo docker run -d motech/motech:centos)
5. If rpm's were correct you should have bootstrap motech on (IP from point 6) ip:8080
6. Use suggestions for inputs
7. SQL Username: mysql SQL Password: password
8. Verify and start motech
5. Check container's IP (ifconfig)
6. If rpm's were correct you should have bootstrap motech on (IP from point 5) ip:8080
7. Use suggestions for inputs
8. SQL Username: mysql SQL Password: password
9. Verify and start motech

25 changes: 25 additions & 0 deletions motech-deb/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ubuntu:15.04

RUN apt-get update

#Install simple tool for installing deb files
RUN apt-get install gdebi-core -y

#Install mysql-server and set password to 'password'
RUN echo "mysql-server mysql-server/root_password password password" | debconf-set-selections
RUN echo "mysql-server mysql-server/root_password_again password password" | debconf-set-selections
RUN apt-get install -y mysql-server

#Install motech DEB with dependencies
ADD /motech-base.deb /motech-base.deb
RUN gdebi --non-interactive motech-base.deb
ADD /motech.deb /motech.deb
RUN gdebi --non-interactive motech.deb

EXPOSE 8080

ADD run.sh /run.sh
RUN chmod a+x /run.sh

CMD ["/run.sh"]

16 changes: 16 additions & 0 deletions motech-deb/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#Building motech-deb image based on deb.

1. Install docker-machine : https://docs.docker.com/engine/installation/linux/ubuntulinux/
2. Copy to destination folder with Dockerfile and run.sh script:
* /motech/packaging/deb/target/motech-base_xxx.deb (rename on motech-base.deb)
* /motech/packaging/deb/target/motech_xxx.deb (rename on motech.deb)
3. sudo docker build -t motech/motech:deb ./destination_folder

#Starting motech from motech-deb image

4. Run image (sudo docker run -d motech/motech:deb)
5. Check container's IP (ifconfig)
6. If container is running properly, motech instance will be available on ip:8080 (IP from point 5)
7. SQL Username: root, SQL Password: password
8. Verify and start motech

18 changes: 18 additions & 0 deletions motech-deb/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Run activemq
ln -s /etc/activemq/instances-available/main /etc/activemq/instances-enabled/main
sed -e 's/<broker /<broker schedulerSupport="true" /' -i /etc/activemq/instances-enabled/main/activemq.xml
service activemq start

# Run mysql
service mysql start

# Start motech service
service motech start

# The container will run as long as the script is running, that's why
# we need something long-lived here
exec tail -f /usr/share/motech/logs/catalina.out