Fun with Spring Cloud and microservice


  • Install docker

    1
    2
    3
    export http_proxy=http://192.168.56.1:21
    curl -x 192.168.56.1:21 -sSL https://get.docker.com/gpg | sudo apt-key add -
    curl -x 192.168.56.1:21 -sSL https://get.docker.com/ | sh
  • Clone spring project

    1
    git clone https://github.com/kbastani/spring-cloud-microservice-example --config "http.proxy=http://192.168.56.1:21"

    cd spring-cloud-microservice-example/

  • Install docker-compose

    1
    curl -x http://192.168.56.1:21 -L https://github.com/docker/compose/releases/download/1.4.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
  • Install Maven
    wget http://apache.communilink.net//maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
    set proxy and repository path (shared by user and root) in conf/settings.xml

  • Install Gradle
    gradle -Dhttp.proxyHost=192.168.56.1 -Dhttp.proxyPort=21 -Dhttps.proxyHost=192.168.56.1 -Dhttps.proxyPort=21 build

  • Install Java (Refer to http://www.tecmint.com/install-java-jdk-jre-in-linux/ or http://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/)
    Download jdk-8u60-linux-x64.gz

    1
    2
    3
    4
    sudo update-alternatives --install /usr/bin/java java /home/user/Software/jdk1.8.0_60/bin/java 3
    sudo update-alternatives --install /usr/bin/javac javac /home/user/Software/jdk1.8.0_60/bin/javac 3
    sudo update-alternatives --set jar /home/user/Software/jdk1.8.0_60/bin/jar
    sudo update-alternatives --set javac /home/user/Software/jdk1.8.0_60/bin/javac
  • Setup docker proxy
    edit /etc/default/docker to set proxy (/etc/sysconfig/docker in CentOS)
    service docker restart
    or

    1
    2
    sudo HTTP_PROXY=http://192.168.56.1:21/ docker -d &
    sudo usermod -aG docker username

Installed software and component