I want to create a Linux Container. I want to use it for developing with eclipse python 2.7 and opencv. I have created a lxc container and started him. How can i install the programs in the container? And how can i put the image on other computer. I dont need it over network. I want to put the image on a usb flash drive and install the image on a other computer.

  • What distro did you use to create your container? – CameronNemo Feb 27 '17 at 16:57

Well, I guess it depends on what kind of distribution you installed into the container. You install software in it by using your container's distribution's package manager and since they're network-dependent, it's best to actually set up the container's networking. That being said, there's another option with no networking where the container uses the packages available on the "mother" system and installs them from there. The third option is the usual "configure, make, makeinstall". You can download a source file on your "mother" system, copy it inside of your LXC rootfs(your home directory in your container, for instance), fire up the container and proceed with the compilation. Bada-bing, bada-boom-you're done! Then you can just copy the container over the network or simply carry it on your flash drive. For all of the above, your containers and their corresponding root fs(s) are located in the var/lib/lxc. For the last option you can just slap any packages or source files from your host system right in there, launch the container and install(compile) "stuffs" at your leisure. I also recommend compressing a container before moving it with tar. ALSO: if you insist on not setting up networking in your container(it can get tiring entering that ssh key over and over), start your container in daemon mode like so sudo lxc-start -n containername -d and then attach to it via sudo lxc-attach -n containername. That's basic RTFM, but there you go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.