Continuous Deployment Using Travis CI and Docker

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

After creating a simple web project using Travis CI and using DockerfileDocker to create the corresponding image, is there any way to automatically cause this image to be deployed to the cloud provider?

Currently, the Dockerfile pulls out the base image to the Travis build machine and creates the image based on the instructions in the Docker file. At this point, if the build is successful, I can click it on the Docker hub, although I do not need to save this image in the Docker hub, which I assume is deploying the successfully created Docker image to the cloud provider (IE. DigitalOcean, Linode, or AWS ) and start / start image.

+4
source share
3 answers

Although clicking directly on the host might seem ideal, I think it ignores the fact that hosts may fail or may have to be replicated.

prod, , CI-.

( ), , , . ( script ).

, ( ).

+2

- Surge.

AWS Elastic Beanstalk (AWS EB CLI) AWS EB.

AWS EB AWS

AWS EB CLI, AWS EB

, , (EB CLI).

$ mkdir HelloWorld
$ cd HelloWorld
$ eb init -p PHP
$ echo "Hello World" > index.html
$ eb create dev-env
$ eb open

, "eb deploy.

+1

.

, Watchtower, Docker. , Watchtower ( env vars ..). , .

NB: , :

docker run -d \
--name watchtower \
-e REPO_USER="username" -e REPO_PASS="pass" -e REPO_EMAIL="email" \
-v /var/run/docker.sock:/var/run/docker.sock \
drud/watchtower container_to_watch --debug

, , , ...

0
source

Source: https://habr.com/ru/post/1611661/


All Articles