10

Docker publish and deploy, cheat sheet

 3 years ago
source link: https://marco.dev/2017/02/06/docker-publish-and-deploy-cheat-sheet/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

In the post Cheap and easy DevOps for developers I described the architecture of the deployment with the focus on the configuration of the proxy.

Here a cheatsheet of the operations that I execute to deploy the Angular & Java application from the client to the server (angular.cafe).

On the client:

  1. compile the application, from the parent module: mvn clean install

  2. build the image, from the directory that contains the Docker configuration: docker build -t javaee/angular2-java-hello-world .

  3. push the image to dockerhub: docker push javaee/angular2-java-hello-world:latest

On the server that hosts the application:

  1. get the image: docker pull javaee/angular2-java-hello-world

  2. stop the running image, angular is the name of the image: docker stop angular

  3. remove the image: docker rm angular

  4. run the new image: docker run --name angular -d -p 8080:8082 javaee/angular2-java-hello-world

Author

Marco Molteni

Marco Molteni Blog


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK