Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automate application deployment when using LXD containers?

Tags:

lxc

lxd

How should applications be scripted/automatically deployed when in LXD containers?

For example is best way to deploy applications in LXD containers to use a bash script (which deploys an application)? How to execute this bash script inside the container by executing a command on the host?

Are there any tools/methods of doing this in a similar way to Docker recipes?

like image 478
Greg Avatar asked Nov 15 '25 01:11

Greg


1 Answers

In my case, I use Ansible to:

  1. build the LXD containers (web, database, redis for example).
  2. connect to the containers and deploy the services and code needed.

you can build your own images for example with the services and/or code already deployed and build specific containers from this images.

I was doing this from before LXD had Ansible support (Ansible 2.2) i prefer to use ssh instead of lxd connection, when i connect to the containers to deploy services/code. they comes with a profile where i had setup my ssh public key (to have direct ssh connection by keys ... no passwords)

like image 199
Yonsy Solis Avatar answered Nov 17 '25 21:11

Yonsy Solis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!