Continuous Deployment Using Travis CI and Docker

DanCat

What is the best way to automate the deployment of a Docker image in a CI environment?

After building a simple web project using Travis CI and using a Dockerfile to build the corresponding Docker image, is there a way to automatically cause that image to be deployed to a cloud provider?

Right now, the Dockerfile pulls down the base image to the Travis build machine and builds the image based on the instructions in the Dockerfile. At this point if the build is successful I can push it to the Docker Hub, though I have no need save this image to the Docker hub, what I envision is deploying the successfully built Docker image to a cloud provider (IE. DigitalOcean, Linode, or AWS) and starting/running the image.

dnephin

While pushing directly to a host might seem ideal, I think it ignores the fact that hosts can fail, or may need to be replicated.

If you push directly to a prod host, and that host goes down, you don't have any way to start another one without re-running the entire CI pipeline.

If you push to an intermediary (the hub or a docker registry), you can create as many hosts as you want without having to re-run the build. You can also recover on a new host very easily (the initialize script can just pull the image and start).

If you wanted to, you could run your own registry on the cloud provider (instead of using the hub).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

What is a good workflow for Continuous Deployment to a VPS using Travis CI and Capistrano?

How to set flyway config in continuous deployment pipeline using Travis CI and Azure?

Continuous deployment using travis and heroku - preserving some kind of state

Deploy Docker Image to CF using Travis CI

Test docker containers using travis-ci

setting up continuous deployment via travis ci for docusaurus - what github scopes to use?

Continuous deployment for node.js applications using CI and CodeDeploy

Local testing of Perl repository using Travis CI (with docker)

using docker image in travis ci (w/o Dockerfile or building a container)

Using Travis CI with Android

Docker Compose Continuous Deployment setup

Pipeline GitHub -> Travis CI -> Docker

Docker practice for CI/CD and deployment

Can Travis CI cache docker images?

Deployment in Travis-CI to GitHub Pages: which files will be uploaded?

Travis CI skip release deployment because this is not a tagged commit

What do the symbols *1 or &2 mean in Travis CI deployment scripts?

PyPi deployment from Travis CI: Invalid or non-existent authentication

How is Travis-Ci's pypi deployment secure?

Travis-CI skipping deployment although Commit is tagged

Travis CI Scala Play Application Build & Deployment Optimization

Using VSTS for Continuous Deployment, config transform not working

Continuous deployment from git using Cloud Build

Continuous Deployment of a NodeJS using GitLab Ask Question

Continuous Deployment of .net core using Jenkins

Travis CI - Using repository environment variables in .travis.yml

Sonarcloud is not authorized using Travis CI and Maven

using travis-ci with wxpython tests

Error authenticating Github using Travis CI

TOP Ranking

HotTag

Archive