Ancestors

Toot

Written by Dust0741@lemmy.world on 2025-01-24 at 04:48

Using Jenkins to deploy Docker containers?

https://lemmy.world/post/24657155

=> More informations about this toot | More toots from Dust0741@lemmy.world

Descendants

Written by tal@lemmy.today on 2025-01-24 at 04:54

Isn’t Jenkins a continuous integration system? I’d think that you’d want a configuration management system (like ansible) if you’re not trying to set up CI infrastructure.

=> More informations about this toot | More toots from tal@lemmy.today

Written by Scrubbles on 2025-01-24 at 04:57

I did Jenkins for a while. It works, but it was built before the world of containers and is now fairly antiquated. Most extensions are no longer maintained.

Look into forgejo, and then use actions to auto deploy

=> More informations about this toot | More toots from scrubbles@poptalk.scrubbles.tech

Written by just_another_person@lemmy.world on 2025-01-24 at 05:02

Why? Tools for this exist. Jenkins is not that tool.

=> More informations about this toot | More toots from just_another_person@lemmy.world

Written by 35qam@lemmy.world on 2025-01-24 at 05:05

Exactly. Look into Komodo instead

=> More informations about this toot | More toots from 35qam@lemmy.world

Written by Dust0741@lemmy.world on 2025-01-24 at 05:07

Like what?

=> More informations about this toot | More toots from Dust0741@lemmy.world

Written by just_another_person@lemmy.world on 2025-01-24 at 05:08

People are naming them all over this thread. Use the right tool for the right job, don’t try to shoehorn a function for a dead-ass and dying tool into a different use-case just because you know it.

=> More informations about this toot | More toots from just_another_person@lemmy.world

Written by Dust0741@lemmy.world on 2025-01-24 at 05:08

Fair. Thank you

=> More informations about this toot | More toots from Dust0741@lemmy.world

Written by damnthefilibuster@lemmy.world on 2025-01-24 at 05:08

You wanna know a fun way to do this?

GitHub (and I think Gitlab too) supports you running their runner within your own infra. It’s literally a binary that needs permissions and space. Then, you can tell your git repo to use that runner to run docker compose and as part of the “build” process, deploy you container to the same or an in-network machine.

This is not secure, it’s probably going to involve a lot of hard coding of local IPs or server names etc. But you can make it work.

I use this way to get a Win11 PC to run some regular containers on itself. Works like a charm.

=> More informations about this toot | More toots from damnthefilibuster@lemmy.world

Written by BrianTheeBiscuiteer@lemmy.world on 2025-01-24 at 17:21

I did this and the fun thing about it is that your runner can access things inside your network that a regular GitLab runner can’t. I’ve used it to manage a k8s cluster that isn’t exposed to the Internet at all.

=> More informations about this toot | More toots from BrianTheeBiscuiteer@lemmy.world

Written by MummifiedClient5000@feddit.dk on 2025-01-24 at 05:52

I use Ansible to deploy a bunch of containers with intradependencies (shared volumes, networks and settings). One of the containers is homemade with the source pulled from codeberg. Variables are kept in a separate file and passwords in an encrypted one and the whole thing is in a private repo. It is quite flexible.

When I started out converting from compose, I literally asked Copilot for “this, but in Ansible”, which got me pretty far.

=> More informations about this toot | More toots from MummifiedClient5000@feddit.dk

Written by atzanteol@sh.itjust.works on 2025-01-24 at 06:05

I’ve heard Ansible is not ideal for docker compose.

Not sure what you heard, but I use available to push docker compose files to VMs and publish containers without issue. Works nicely.

I usually create systemd service files to start/stop the compose jobs and have ansible set it all up.

=> More informations about this toot | More toots from atzanteol@sh.itjust.works

Written by BrianTheeBiscuiteer@lemmy.world on 2025-01-24 at 17:06

I don’t think it necessarily needs to be either or. Organizing the playbooks and folders myself can be stressful so an extra layer of organization might work best for you. There are other tools like Semaphore that are specifically built for Ansible executions though. Might need a lot of duct tape for Jenkins to run Ansible.

And if you’re not a fan of yaml you can always nope out and embed shell scripts into your Playbooks. You can even put Docker compose yaml inside a playbook but it’s a bit inception-y and I don’t really recommend that.

=> More informations about this toot | More toots from BrianTheeBiscuiteer@lemmy.world

Written by liliumstar@lemmy.dbzer0.com on 2025-01-24 at 07:37

I’ve used Ansible to deploy docker compose and it worked pretty well. You will have to do some learning if you aren’t familiar with it, but I’d say it’s worth it.

Like others, I would not recommend Jenkins.

=> More informations about this toot | More toots from liliumstar@lemmy.dbzer0.com

Written by moonpiedumplings@programming.dev on 2025-01-26 at 02:34

I’m gonna be real: You want kubernetes + gitops (either fluxcd or argocd).

I mean sure, jenkins works, but nothing is going to be as smooth as kubernetes. I originally attempted to use ansible as ,any people suggested, but I got frustrated becuase it struggled to manage state in a truly declarative way (e.g. when I would change the ports in the ansible files the containers wouldn’t update, I had to add tasks for destroying and recreating the containers).

I eventually just switched to kuberneted + fluxcd.

=> More informations about this toot | More toots from moonpiedumplings@programming.dev

Written by ToxicWaste@lemm.ee on 2025-01-26 at 08:14

as @damnthefilibuster@lemmy.world already mentioned: GitLab CI

Jenkins is a CI application from before CI was cool. GitLab CI is integrated and can trigger on certain events. Additionally you mentioned, that you want to publish on a public repo anyway.

You are probably are comfortable with containers. So GitLab CI should be easy for you to learn - as it pretty much starts up a container to do certain tasks. I’ve seen suggestions for Kubernetes, which for sure is the more mature solution. But i would question, whether you need the added functionality and complexity of K8s for a home setup.

To gain access to your local network, you can use the runner for a secure connection (as described by damnthefilibuster). or you could SSH into the machine, as long as you have it in a DMZ. Drawback is that you have to be more sure about your network infrastructure. Benefit is that it is a more general approach. Obviously you need to store all certs, keys and preferably even addresses in secrets, not the .gitlab-ci.yml.

As you can see from this thread, there are many ways which lead to rome. My advice is to start with something simple and lightweight, which you understand. adding complexity down the road is easier, than removing it.

=> More informations about this toot | More toots from ToxicWaste@lemm.ee

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113881520212740279
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
328.898873 milliseconds
Gemini-to-HTML Time
3.81585 milliseconds

This content has been proxied by September (3851b).