-
Notifications
You must be signed in to change notification settings - Fork 4
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
kmadej
wants to merge
3
commits into
motech:master
Choose a base branch
from
kmadej:MOTECH-2121
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM ubuntu:latest | ||
|
||
RUN apt-get update | ||
|
||
#Install Java 8 | ||
RUN apt-get install software-properties-common -y | ||
RUN add-apt-repository ppa:webupd8team/java | ||
RUN apt-get update | ||
# Set some vars so the oracle installer doesn't ask us to accept the license | ||
RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections | ||
RUN echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections | ||
RUN apt-get install -y oracle-java8-installer | ||
|
||
#Install tomcat, activemq, mysql, curl | ||
RUN apt-get install tomcat7 -y | ||
RUN apt-get install -y activemq mysql-server curl | ||
|
||
#Install motech DEB | ||
ADD /motech-base.deb /motech-base.deb | ||
RUN dpkg -i motech-base.deb | ||
ADD /motech.deb /motech.deb | ||
RUN dpkg -i motech.deb | ||
|
||
EXPOSE 61616 8161 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any reason for exposing the ActiveMQ port? |
||
EXPOSE 8080 | ||
|
||
ADD run.sh /run.sh | ||
RUN chmod a+x /run.sh | ||
|
||
CMD ["/run.sh"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Run activemq | ||
sudo 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 | ||
# Set password = 'password' for root | ||
mysql -uroot -e "UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'" | ||
mysql -uroot -e "FLUSH PRIVILEGES" | ||
|
||
# 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 | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't installing motech install java as dependency, just wondering if we need these steps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Motech (from version 0.28) needs Java 8. In deb packaging there is hardcoded path to java-8-oracle. So we need exactly this java. To install java-8-oracle on ubuntu we need all these steps. I checked it one more time to be sure.
Currently there is a problem with deb packaging on the latest master. I will create a ticket for it. However this docker container should work correctly with other motech versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked into this - we should update the JDK list in the daemon script. We cannot use Java 7 after version 0.28.X