LXC, alternative Linux à Docker Toolbox
Mis à jour le
Notre avis
LXC is a viable replacement for Docker Toolbox if you need lightweight, full-system containers with low overhead and strong isolation, especially for development or testing Linux environments. However, it's not designed for application containerization the way Docker is. It suits system administrators and power users comfortable managing Linux containers at the OS level, but not developers relying on Docker's image ecosystem and tooling. LXC avoids VirtualBox and supports rootless operation, but lacks built-in orchestration and CI/CD integration out of the box.
- Licence
- GPL-2.0
- Prix
- Gratuit
- Dernière version
- 7.0.0
- Note
- —
Ce qui fonctionne pareil
- Both run Linux containers on hosts without native support via lightweight virtualization
- Support CLI-driven container management
- Enable unprivileged (rootless) container execution for security
- Integrate with host networking using bridges
- Run isolated environments with minimal overhead compared to full VMs
Ce qui change
- LXC focuses on system containers (booting init systems), not application containers
- No built-in equivalent to Docker Compose or image registries
- No native support for Dockerfile-based builds or Docker images
- Tooling and workflows differ significantly from Docker's ecosystem
- Missing standardized export formats for Docker-compatible CI/CD pipelines
Ouvrir vos fichiers Docker Toolbox
LXC cannot directly open or import Docker Toolbox files like .tar images or Dockerfiles. Docker images are built and layered differently than LXC container templates. You cannot run a Docker export in LXC without rebuilding the environment from scratch. While both use kernel features like cgroups and namespaces, their container formats and metadata are incompatible. Migration requires recreating containers using LXC's template system or converting images manually with external tools, which is error-prone and not automated.
Passer de Docker Toolbox à LXC, étape par étape
- Install LXC using your distribution's package manager (e.g., apt install lxc on Ubuntu)
- Set up unprivileged container support by configuring /etc/subuid and /etc/subgid
- Create a container using lxc-create with a distribution template (e.g., lxc-create -t ubuntu -n mydev)
- Start and access the container via lxc-start and lxc-attach
- Rebuild required services inside the container, as Dockerfiles and images won't port directly
- Automate startup and networking via LXC config files or systemd integration
Fonctionnalités clés de LXC
- Virtualisation au niveau du système d'exploitation utilisant les cgroups et les namespaces du noyau
- Prise en charge des conteneurs système et d'application
- Accès direct au noyau hôte avec une surcharge minimale
- Automatisation possible via des outils en ligne de commande comme lxc-create, lxc-start
- Prise en charge de la migration à chaud dans certaines configurations
- Intégration avec les ponts réseau et les VLAN
- Possibilité d'exécuter des conteneurs non privilégiés pour renforcer la sécurité
- Intégration mature avec les systèmes d'initialisation (systemd, upstart)
Installer LXC sous Linux
sudo apt install lxcsudo apt install lxcsudo dnf install lxcsudo pacman -S lxcsudo zypper install lxcQuestions fréquentes
Can I run Docker inside an LXC container?
Running Docker inside LXC is possible but requires privileged containers and additional kernel permissions, which reduces isolation and security. It's not recommended for production and adds complexity compared to using Docker natively or via rootless mode on modern Linux.
Does LXC support Docker-like networking and port mapping?
LXC supports network bridges and custom interfaces, and you can set up port forwarding manually using iptables or firewalld. However, it lacks Docker's automatic -p port publishing and built-in DNS/service discovery between containers.
Is LXC suitable for modern microservices development?
Not directly. LXC is better suited for running full Linux systems, not microservices. For that workflow, consider Podman or Docker on native Linux instead, which support OCI images and Compose without VirtualBox.