Skip to content

Instantly share code, notes, and snippets.

@VVCepheiA
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VVCepheiA/b46397e4f75f834f93db to your computer and use it in GitHub Desktop.
Save VVCepheiA/b46397e4f75f834f93db to your computer and use it in GitHub Desktop.
Docker on Linux

Docker Setup on Linux

Note: THIS GUIDE IS NOT TESTED YET! The following steps are meant to create an environment for deploying app with tomcat and mysql with a war file. Assuming you are using Linux. For the Mac local version, please go here.

  1. Install Docker following the guild here.

  2. Go here and follow the step there to get the mysql image/Dockerfile. It's a good idea to create a new empaty folder for the files from the repo. Replace the "XXXXXXXX" with desired username/password.

$ sudo docker run -d --name db -e MYSQL_USER="XXXXXXXX" -e MYSQL_PASSWORD="XXXXXXXX" -e MYSQL_ROOT_PASSWORD="XXXXXXXX"  -e MYSQL_DATABASE="rekomendi" -p 3306:3306 mysql
  1. Go here and follow the step there to build the tomcat image. It's a good idea to create a new empaty folder for the files from the repo. Also, you should put the war files you want to deploy in this folder.
$ sudo docker build -t tutum/tomcat .

Then link it with the mysql we created earlier.

$ sudo docker run -d -p 8080:8080 --name web-sql --link rek-mysql:mysql tutum/tomcat
  1. Now /*hopefully*/ you are able to access [server ip]:8080/rekomendi-cockpit
    Note: The port mapping is highly customizable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment