Тёмный

Installing Docker and Portainer in LXC 

Allen Sampsell
Подписаться 3,4 тыс.
Просмотров 22 тыс.
50% 1

This is the first follow-on video to creating a Ubuntu 18.04 based LXC container in Proxmox to run Docker. In this video I actually install Docker and then show how to install Portainer.
Docker install to follow: www.digitaloce...
Docker Hub Portainer Image: hub.docker.com...
Porainer's Install website: portainer.read...

Опубликовано:

 

4 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 89   
@helavarlden8466
@helavarlden8466 5 лет назад
Great video, thanks. I like the fact that you actually explain what the different parameters on the command line do instead of just listing out things. I would, however, move the picture-in-picture box to the upper right hand corner. Then we could see what you type.
@AllenSampsell
@AllenSampsell 5 лет назад
Thanks and yes I'm learning many lessons when it comes to making these videos. :)
@cfaber01
@cfaber01 5 лет назад
Thank you for the thorough explanation. My Portainer instance stopped working for several weeks...this got me back on track.
@usshauler
@usshauler 5 лет назад
I loved the fact that you explained everything slowly and thoroughly. Can you please show us how to install Traefik in the Docker environment using Portainer as well, thank you and keep up the great work.
@AllenSampsell
@AllenSampsell 5 лет назад
I don't think I can setup Traefik due to my own network settings but you would just use the command line to install it and use Portainer to manage it once it's online. I've not found Portainer particularly easy to install containers from. Also, in order to take advantage of Traefik you'll need to be using one of the orchestration programs like Rancher or Kubernetes that has an API it can interface with...
@chefvoyardee7681
@chefvoyardee7681 4 года назад
Fantastic video, really solved my issues. I also enjoy the background explanations as I continue to familiar myself with all things Linux. Keep it going my friend!
@AllenSampsell
@AllenSampsell 4 года назад
Check back soon. I've got a new way to use Docker in an LXC that's even more useful I think. Probably be my next video...
@chefvoyardee7681
@chefvoyardee7681 4 года назад
Looking to it!
@jwilk2107
@jwilk2107 4 года назад
I just discovered your videos. Great work!!
@AllenSampsell
@AllenSampsell 4 года назад
Jim Wilkinson Thanks! If you’re just getting into Docker on Proxmox,LXC is a great place to start. I’m working on a rerack of all my server equipment and when I’m done with that I’ve got a few more videos I’ll be making. One will be an updated way of running Docker in LXC.
@MrTifter
@MrTifter 4 года назад
Great video! Would love to see some container installation guides
@cyberphox
@cyberphox 4 года назад
Thanks Allan. These videos are great and I actually like you aren't using a script
@AllenSampsell
@AllenSampsell 4 года назад
Thanks. I'm going to keep trying. :)
@neo85271
@neo85271 5 лет назад
As an addendum, if you're looking for any ideas for subjects of upcoming videos you might look into a video on setting up backups for your container's persistent data using something like rsync or borg backup, and possibly using something like watchtower or ouroboros for automatically keeping your containers up to date. Just suggestions, cheers!
@AllenSampsell
@AllenSampsell 5 лет назад
Thanks for the input. I've actually heard of Watchtower just not sure I need that much automated updating at this point. :)
@selfhosted
@selfhosted 4 года назад
FYI you can scroll up in version 6 of proxmox console. :)
@AllenSampsell
@AllenSampsell 4 года назад
Geeked you are absolutely correct. In my latest videos I use that feature a lot.
@ITSecurityLabs
@ITSecurityLabs 5 лет назад
Nice video Allen. What kind of camera are you using?
@AllenSampsell
@AllenSampsell 5 лет назад
I've actually used three or four different ones in all my videos but in this one it's a Logitech C922 Pro Stream Webcam. I like using my iphone 8 as well but it ties my phone up for long periods of time so I've headed back to this one.
@jothain
@jothain 5 лет назад
Thanks. This was interesting to watch and I especially appreciate that you tried to tell what commands actually do. I really don't like when some tutorials tell to pretty much run some script from somewhere and "it's all right/done". Also do you have any beginner tips where to find bit more depth information about Docker and LXC's both? I'm really just looking into Proxmox and LXC is bit confusing. Say I ie. I don't fully understand when upgrading LXC system you might get prompt like "do you want to keep original/changed setup X" or something like change confirmations in something like vnc. I though LXC is using just same kernel from OS, but it quickly seems that are some other system files also common with OS host?
@neo85271
@neo85271 5 лет назад
To start off, thank you for making these videos! Seeing these kinds of tutorials is very helpful to a visual learner like myself, and I find that frequently tutorials presented as text alone will leave out some steps that might be important. I also noted that the VNC you're using is set as the default NoNVC which does have the issues you noted such as scrolling and the ability to copy and paste into the virtual terminal. You might consider changing your default in Proxmox to xterm.js as it does enable scrollback and has the ability to copy from and paste into the terminal, so it might be a benefit to you if you need quick access to a running vm/lxc. Another question I had was about the docker status. When running docker inside a lxc I'm seeing similar warnings you seem to have when you pull up the docker.service status. Have you run into any issues running containers at all?
@AllenSampsell
@AllenSampsell 5 лет назад
I actually have tried that xterm.js but it started not accepting commands and throwing up strange characters, otherwise I was ready to switch to it. And glad you like the videos.
@verygoodbrother
@verygoodbrother 3 года назад
It would great especially for us linux noobs if you could include the commands in the description or if you have a website include it there 😁 Otherwise, thanks for the tutorial and more importantly explaining how, why and reasoning behind your commands/actions instead of other youtubers where they just ramble through things without background info (for example elaborating/explaining persisting infomation ) 👍
@AllenSampsell
@AllenSampsell 3 года назад
I did include the link to the install steps for Docker and Portainer in the description... Just too much info to put in the Videos Description box. :)
@verygoodbrother
@verygoodbrother 3 года назад
@@AllenSampsell ah missed it. Do you have a good resource to setup nextcloud on the ubuntuLXC?
@AllenSampsell
@AllenSampsell 3 года назад
@@verygoodbrother sorry not directly in Docker but I’m sure there has to be an image on DockerHub for NextCloud. I run mine through a Univention Corporate server. One stop shopping for my website that I selfhost.
@verygoodbrother
@verygoodbrother 3 года назад
@@AllenSampsell ​quick question (hopefully). In this tutorial from Techno life dad (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-4HPXGKfFibc.html) he mentions we have to put in the absolute path. This case of ubuntuLXC where will I find this?
@AllenSampsell
@AllenSampsell 3 года назад
@@verygoodbrother you won’t. His installation instructions with regards to using the absolute path is required because he’s running Docker on Open Media Vault (OMV). If you’ve installed Docker directly into an LXC like in my video you can just create a Docker volume “docker volume create ncfiles” or whatever. Make those first and incorporate into the proper stack lines.
@abohm25
@abohm25 5 лет назад
Great job with the video. Really appreciate it! I am running into an issue with docker exec commands on any containers that are created. docker exec -it portainer /bin/sh I get the following error: OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown I even get an error when I run: docker exec -it portainer ls . OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"ls\": executable file not found in $PATH": unknown I also get an error from portainer as well. Is this have something to do with docker running in a container and not kvm? I have restarted my lxc and still see the issue. Thanks in advance.
@tommix6733
@tommix6733 5 лет назад
Hi Allen, thank you for this helpful video. I've followed your tutorial, but I've hit a snag. Could you please provide your thoughts on my problem? I've made an LXC container that is unprivileged, and I've enabled both keyctl and nesting under options. However, whenever I try to run a docker image (even just hello-world fails) I get an error mounting to the rootfs which is typically a namespace issue that should be resolved with the nesting option I set. I also am using zfs file system. Do you have any ideas on what might fix this problem?
@AllenSampsell
@AllenSampsell 5 лет назад
Tom, I hate to say it but the use of ZFS might just be the issue. I can't say for certain but I have run into people doing this using ZFS and they couldn't get it to work. I don't know why exactly. Any chance you could install the LXC to a drive using Directory? Or maybe copy your LXC so you don't have to redo all the steps?
@tommix6733
@tommix6733 5 лет назад
@@AllenSampsell Thanks! Yeah, I'll copy it off. It does look like ZFS might be the issue.... I guess I'd have to run it in a full VM for the ZFS node?
@AllenSampsell
@AllenSampsell 5 лет назад
@@tommix6733 A full VM should bypass the ZFS issue. But please let me know if it still causes any problems.
@MultiHp1234
@MultiHp1234 5 лет назад
@Tom Mix You might want to check this out: forum.proxmox.com/threads/docker-in-lxc-problem-after-pve-kernel-update.56948/
@williamlew3127
@williamlew3127 4 года назад
@@MultiHp1234 omg thank you for this link. read through that thread and checked on keyctl & nesting in options - features and it worked! I had a "docker: Error response from daemon: OCI runtime create failed:..." that i couldn't figure out or find on the webs until i found this comment! thanks!
@davidwynn7107
@davidwynn7107 5 лет назад
nice vid thx
@tsingh7491
@tsingh7491 4 года назад
Thanks for the video. Can you do one with portainer swarm deployment on docker?
@AllenSampsell
@AllenSampsell 4 года назад
Sorry, I just don't have any experience with Docker Swarm. But have you found these guys? www.katacoda.com/courses/docker-orchestration/getting-started-with-swarm-mode and this one www.katacoda.com/portainer/scenarios/deploying-to-swarm
@fbifido2
@fbifido2 4 года назад
Would it be better to run Ubuntu with docker & Portainer on your server for all your containers needs without using Proxmox ???
@AllenSampsell
@AllenSampsell 4 года назад
That depends on your use case and familiarity with Linux. I like the aspect of Proxmox that I can backup the VM of Ubuntu before doing major changes and I can always roll back to a backup if I screw something up. If you install it bare metal you don't get that opportunity. But it would still work.
@MrTifter
@MrTifter 4 года назад
If i were to set up, for example, sonarr. As I understand it, it would be appropriate to create a new docker volume, named sonarr, for the installation of the container? I also bind mounted my network share to the ubuntu lxc container. So my plan was to bind mount the download folders to the network share in the container. Is this how I should setup programs that manage data outside the container, or am I completely off track? Tried to explain as best as i could. I'm pretty new to linux in general
@AllenSampsell
@AllenSampsell 4 года назад
I believe you have the right idea. A new Docker Volume for the config files for Sonarr is how I would do it too. But did you create your LXC Ubuntu as unprivileged? If you did, I don't think you can bind mount your network drives directly. You'd probably have to mount them to the host Proxmox and then they could be bind mounted from there inside the unprivileged LXC... The unprivileged LXC should not be able to access network shares etc but should be able to "see" whatever the host has access to.
@MrTifter
@MrTifter 4 года назад
@@AllenSampsell Great! I mounted them in proxmox and it seems to be working as I intended. Thanks for your help!
@StephenCunningham1
@StephenCunningham1 4 года назад
Two issues I've ran into using an lxc are persistent NFS shares(shares mount but not) and docker compose. Has anyone figured out how to do this in an lxc?
@AllenSampsell
@AllenSampsell 4 года назад
So if you setup the LXC as non-privileged you won't be able to connect any shared services directly to containers. I believe the trick is to mount the NFS to the host system, so Proxmox but not through the gui, and then the LXC should be able to see it indirectly. Of course you'll need to mount in the containers as a bind mount to the exact share folder available on the host. At least I think that's how it would work. And I'm not sure what issue you have with docker compose... it's there I just don't use it. And portainer supports older versions of compose so there's that to play with if you want.
@StephenCunningham1
@StephenCunningham1 4 года назад
@@AllenSampsell I was running into all different issues with apparmor blocking stuff. I tried all different ways but just couldn't get it to work. I spun up a vm instead and everything went super smooth. I'd like it to be an LXC but everything I read said docker is not really meant to be run in LXC.
@AllenSampsell
@AllenSampsell 4 года назад
Stephen Cunningham I agree VMs are easier to run Docker in but the trade off is sometimes worth it depending on the use case. My daily Docker needs are rather small and fit quite well within the LXC small footprint. I run Heimdall and Tautulli and Ubooquity pretty much 24/7. But I admit it would be much nicer to point Ubooquity to a network share rather than upload all the books and manga into the LXCs virtual hard drive.
@leonbao3296
@leonbao3296 3 года назад
I found there is a problem that I can't install Docker and NFS in same LXC server, because the NFS will need Unprivileged set to No, then the keyctl couldn't select. The docker wouldn't work without keyctl.
@AllenSampsell
@AllenSampsell 3 года назад
True. That’s by design. You’ll need to mount the NFS shares to the host Proxmox system and then pass it on to the LXC.
@huntermcclovio4517
@huntermcclovio4517 3 года назад
Allen I got stuck on the Docker-ce part...when I type it, it shows no available packages and then if I proceed I get this: Package docker-ce is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'docker-ce' has no installation candidate
@AllenSampsell
@AllenSampsell 3 года назад
And you're following the Docker install from Digital Ocean that I linked in the Description? When you run "apt-cache search docker" what shows up?
@aaronjameshorne
@aaronjameshorne 4 года назад
Hi Allen. Great video. Why are we installing/running docker if we are creating lxc ct in proxmox? I think I am missing something.
@AllenSampsell
@AllenSampsell 4 года назад
Aaron Horne it’s just a personal preference. I like the speed and size of the LXC vs running an entire VM. I like the Docker environment and just don’t quite know what to do with LXCs. I see a bunch of turn key solutions for them but nothing quite like the Docker Hub. Creating the LXC and putting Docker inside it is nested virtualization but it just seems to work for me. So again I find it useful and hoped others would as well. Could you tell me what the advantage of LXC over Docker would be? I’ll admit I made it do what I wanted and never really looked that hard at LXCs.
@aaronjameshorne
@aaronjameshorne 4 года назад
@@AllenSampsell For what I do no diference. I haven't used lxc in my proxmox environment before so I was wondering. Since viewing your video I'm spinning up more lxc than vms.
@AllenSampsell
@AllenSampsell 4 года назад
@@aaronjameshorne Nice. I'd love to hear what projects you're looking at for LXCs. Like docker containers they can be small and powerfull but I just don't have the right use case for them.... yet.
@jamieforrester7108
@jamieforrester7108 4 года назад
@@AllenSampsell I'm extremely resource limited (i3 and 8gb of ram) but run a bunch of small LXC's just acting as mini servers. Pihole, homeassistant, emby, mqtt,... that way if I want to try something different I just spin up a new one and power down the old one. the lxc's are really light resource wise. Most of mine are 512mb ram, 1 core and 8gb disk and aren't even coming close to maxing that. The reason I'm adding docker to some LXC's in a few cases is some things are just easier to do via docker. homeassistant for example is intended to run in a venv and it gets weird in an lxc when it comes to updating and so on. Lots of things have docker installs available and as they are quite popular they tend to just work. It's a little more resource intensive due to the nested virtualization vs a native LXC install but it should be pretty minor.
@AllenSampsell
@AllenSampsell 4 года назад
Jamie Forrester I appreciate the feedback. I still haven’t begun to utilize LXCs the “right” way but I’m still using one with Docker in it 24/7. Definitely better than a full VM for what it does.
@SFX773
@SFX773 5 лет назад
I seem to be unable to pull images from docker. I get the message that it has not been found locally, but then it times out. I looked it up online, and I see suggestions about proxy settings, but I have no clue how to set that up. Is the LXC container blocking this somehow?
@AllenSampsell
@AllenSampsell 5 лет назад
I haven't run into that issue but definitely is a networking issue. First I'd try to ping your gateway or DNS from inside the LXC. Or really ping anywhere on the internet like Yahoo.com or google to test connectivity. If that is failing you check the IP address settings of the LXC. Maybe you set it static and fat fingered a digit? If the only thing you can't get to is dockerhub then you gotta check your Firewall settings. Also see if any other machine on your network can get to the website... Just some thoughts for you.
@antoninoromeo4015
@antoninoromeo4015 4 года назад
Hi Allen, great job! in your opinion ina lxc ubuntu docker can i use gpu passthrough? tks
@AllenSampsell
@AllenSampsell 4 года назад
From what I've been told GPU passthrough to an LXC is possible. But then adding that GPU to a Docker container inside is something I've never heard of. So definitely interested in the results if you test this out.
@llortaton2834
@llortaton2834 2 года назад
Using quadro on jellyfin to handle up to 3 works
@llortaton2834
@llortaton2834 2 года назад
3 transcode streams
@lts8709
@lts8709 5 лет назад
When I made mines on the portainer local is says down. Not sure what I did wrong.
@AllenSampsell
@AllenSampsell 5 лет назад
lts8709 need a little more clarity here. Is Portainer down or a container inside Portainer? What command did you use to create either one?
@lts8709
@lts8709 5 лет назад
@@AllenSampsell I was able to fix it. I just nuked the lxc and started from scratch. Everything worked after that. Thanks for all your help.
@AllenSampsell
@AllenSampsell 5 лет назад
@@lts8709 not a problem. That's kind of what I love about using LXC. Pretty easy to get up and running again in very little time.
@lts8709
@lts8709 5 лет назад
@@AllenSampsell Yes so much better than a full blown VM.
@lts8709
@lts8709 5 лет назад
How would I go about installing remoter? Any site with instructions?
@AllenSampsell
@AllenSampsell 5 лет назад
lts8709 what is Remoter to you? Is it a docker image? Got a link? I use a Mac program called Remoter that does all kinds of connections. It’s pretty easy to setup though.
@lts8709
@lts8709 5 лет назад
@@AllenSampsell Well really just setting up ssh to work in the lxc container. I use bitvise for ssh.
@AllenSampsell
@AllenSampsell 5 лет назад
@@lts8709 so depending on the LXC that can be tricky. The Ubuntu LXC I created had SSH turned off so I had to find a guide to turn it on so that I could use Remoter in the first place. remoterlabs.com/
@lts8709
@lts8709 5 лет назад
@@AllenSampsell I did the same had to edit sshd file with nano to enable it.
@AllenSampsell
@AllenSampsell 5 лет назад
@@lts8709 exactly what I did. I prefer nano as well.
@andrejerjavec3048
@andrejerjavec3048 4 года назад
When performing apt update I get an error saying "Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable)" Does anyone have a similar issue?
@AllenSampsell
@AllenSampsell 4 года назад
Can you ping google.com from inside the LXC? Sounds like a local networking issue.
@andrejerjavec3048
@andrejerjavec3048 4 года назад
@@AllenSampsell I tried pinging my DNS, which works.
@AllenSampsell
@AllenSampsell 4 года назад
Andrej Erjavec that’s good but I’m assuming that’s still internal to your network. Can you ping external sites as well?
@andrejerjavec3048
@andrejerjavec3048 4 года назад
@@AllenSampsell I just installed Ubuntu in a VM and it works perfectly now.
@AllenSampsell
@AllenSampsell 4 года назад
Andrej Erjavec glad it’s working. A small VM is always a good option as well.
Далее
18 Weird and Wonderful ways I use Docker
26:18
Просмотров 235 тыс.
小路飞嫁祸姐姐搞破坏 #路飞#海贼王
00:45
How Many Twins Can You Spot?
00:17
Просмотров 20 млн
PERFECT PITCH FILTER.. (CR7 EDITION) 🙈😅
00:21
Просмотров 3,4 млн
Install Docker and Portainer in Proxmox on a Ubuntu VM
17:24
Using docker in unusual ways
12:58
Просмотров 452 тыс.
Don’t run Proxmox without these settings!
25:45
Просмотров 230 тыс.
Creating a Ubuntu LXC in Proxmox for Docker
15:10
Просмотров 34 тыс.
The cloud is over-engineered and overpriced (no music)
14:39
Never install locally
5:45
Просмотров 1,8 млн
小路飞嫁祸姐姐搞破坏 #路飞#海贼王
00:45