Publishing LXD images
Canonical
on 30 June 2015
Tags: containers , docker , LXD , Ubuntu , Wily Werewolf

While some work remains to be done for ‘lxc publish’, the current support is sufficient to show a full cycle of image workload with lxd.
Ubuntu Wily comes with systemd by default. Sometimes you might need a Wily container with upstart. And to repeatedly reproduce some tests on Wily with upstart, you might want to create a container image.
# lxc remote add lxc images.linuxcontainers.org # lxc launch lxc:ubuntu/wily/amd64 w1 # lxc exec w1 -- apt-get -y install upstart-bin upstart-sysv # lxc stop w1 # lxc publish --public w1 --alias=wily-with-upstart # lxc image copy wily-with-upstart remote: # optional
Now you can start a new container using
# lxc launch wily-with-upstart w-test-1 # lxc exec w-test-1 -- ls -alh /sbin/init lrwxrwxrwx 1 root root 7 May 18 10:20 /sbin/init -> upstart # lxc exec w-test-1 run-my-tests
Importantly, because “–public” was passed to the lxc publish command, anyone who can reach your lxd server or the image server at “remote:” will also be able to use the image. Of course, for private images, don’t use “–public”.
About the author

Serge Hallyn works for Canonical as a member of the Ubuntu Server team, with a particular focus on the virtualization stack. He has been involved with containers since the first upstream kernel patches for uts and pid namespaces. He was involved with LSM from the start, is listed as co-maintainer of the security subsystem and capabilities, and is a core maintainer of the LXC project.
Fast, dense, and secure container and VM management at any scale
LXD brings flexible resource limits, advanced snapshot and networking support, and better security — all making for easier, leaner and more robust containerised solutions and VMs.
Newsletter signup
Related posts
KubeCon Europe 2025: Containers & Connections with Ubuntu
It’s hard to believe that the first KubeCon took place nearly 10 years ago. Back then, Kubernetes was still in its early days, and the world was only just...
Rivos and Canonical partner to deliver scalable RISC-V solutions in Data Centers and enable an enterprise-grade Ubuntu experience across Rivos platforms
Rivos Inc. brings scalable, high-performance AI accelerating solutions to the Data Center, helping to turn the benefits of both AI and Data Analytics into a...
Ubuntu now officially supports NVIDIA Jetson: powering the future of AI at the edge
Canonical announces the General Availability of Ubuntu for the NVIDIA® Jetson Orin™ for edge AI and robotics, bringing optimized performance, out-of-the-box...