I just recently stumbled over DroneCI through a YouTube video and it looked very interesting. At the moment, I’m using bash scripts to build and update my container. The building I got already running in DroneCI but I’m a bit stuck with the deployment. Trouble - or not - is that I’m not using a registry. I havent found any easy to deploy self-hosted registry yet and I’m not sure if deploying one just for that one website project would be worth the effort. I don’t really want to use a public registry because my website code is not open source.
So, at the moment, I’m directly deploying through ssh like this:
docker save container:latest | bzip2 | pv | ssh [email protected] 'bunzip2 | sudo docker load'
Would there be any way to do this with DroneCI?
Greetings and thanks in advance!
You can use Docker plugin and can configure registry and repo accordingly as mentioned in below doc:
Example configuration using a custom registry:
- name: docker
thanks but as I wrote, I’m explicitly not using any registry. I’m deploying the image directly through docker save / docker load via an SSH pipe.
@sgofferj how would you deploy an image directly through docker save / docker load via ssh on your laptop? Likely you would write a shell script. You can take this same approach in Drone.
- name: build
Note that if you are building docker images you may need to mount the host machine docker socket as shown in this example: Docker | Drone
OK, I’ll try that! Thanks
Have to jump through a few hoops for ssh public key auth but it works great.
One thing though: the command has to be
- sh buildscript.sh
Apparently GIT doesn’t sync executable bits, so just calling the script’s name doesn’t work.