LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.

Notices


Reply
  Search this Thread
Old 12-09-2017, 02:25 PM   #1
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221

Rep: Reputation: 36
Where is the documentation for the lxc launch command that uses "images:"?


Hi,

My ultimate goal is to create a LXD container that replicates, as close possible, one of my real RHEL 6.7 machines contains in terms of both kernel images and packages. If I have to use a CentOS 6.7 initially before talking to Red Hat Sales, that is fine too. The goal is to be able to ultimately execute some processes within that container but under varying conditions such as memory and CPU resources, which, from all I've read, indicate that is possible.

Working through the tutorials, I ran into a documentation issue:

From https://linuxcontainers.org/lxd/getting-started-cli/ I see:

Code:
To start a container from them, simply do:
...
lxc launch images:centos/6/amd64 my-centos
I've verified this works on my Ubuntu 17.10 desktop:
Code:
drunkard@thebar:~$ lxc launch images:centos/6/amd64 my-centos
Creating my-centos
Starting my-centos
drunkard@thebar:~$ lxc list
+---------------+---------+---------------------+-----------------------------------------------+------------+-----------+
|     NAME      |  STATE  |        IPV4         |                     IPV6                      |    TYPE    | SNAPSHOTS |
+---------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| first-machine | RUNNING | 10.58.21.150 (eth0) | fd42:702a:7a67:d113:216:3eff:fee2:dfa6 (eth0) | PERSISTENT | 0         |
+---------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| my-centos     | RUNNING | 10.58.21.69 (eth0)  | fd42:702a:7a67:d113:216:3eff:fe03:86b (eth0)  | PERSISTENT | 0         |
+---------------+---------+---------------------+-----------------------------------------------+------------+-----------+
drunkard@thebar:~$
(the first-machine was from an earlier experiment with an ubuntu container). I need to know what the proper syntax is for that "images:XXXX" part of the command. Where do they get the "amd64" in the "images:centos/6/amd64" part of the command?

I viewed the man page for lxc and it is not indicating the details of what is to the right of the ":" there.

I can "see" what is "out there" but I don't know what "where" is, from a command of:

Code:
drunkard@thebar:~$ lxc image list images: | grep -C1 -i centos
+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+
| centos/6 (3 more)               | 64b9709c2368 | yes    | Centos 6 amd64 (20171209_02:16)          | x86_64  | 75.58MB  | Dec 9, 2017 at 12:00am (UTC)  |
+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+
| centos/6/i386 (1 more)          | dcf545b99fec | yes    | Centos 6 i386 (20171209_02:16)           | i686    | 75.74MB  | Dec 9, 2017 at 12:00am (UTC)  |
+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+
| centos/7 (3 more)               | 3230d10b1ab5 | yes    | Centos 7 amd64 (20171209_02:16)          | x86_64  | 82.22MB  | Dec 9, 2017 at 12:00am (UTC)  |
+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+
--
+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+
|                                 | 2e325f5f2bfe | yes    | Centos 6 amd64 (20171207_02:16)          | x86_64  | 75.58MB  | Dec 7, 2017 at 12:00am (UTC)  |
+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+
|                                 | 411ad3f9de4a | yes    | Centos 6 amd64 (20171208_02:16)          | x86_64  | 75.58MB  | Dec 8, 2017 at 12:00am (UTC)  |
+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+
|                                 | 7aeb93209940 | yes    | Centos 6 i386 (20171207_02:16)           | i686    | 75.74MB  | Dec 7, 2017 at 12:00am (UTC)  |
+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+
|                                 | 9b0db8db5995 | yes    | Centos 6 i386 (20171208_02:16)           | i686    | 75.74MB  | Dec 8, 2017 at 12:00am (UTC)  |
+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+
|                                 | b71f00b408da | yes    | Centos 7 amd64 (20171207_02:16)          | x86_64  | 82.21MB  | Dec 7, 2017 at 12:00am (UTC)  |
+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+
|                                 | 468dd7e55654 | yes    | Centos 7 amd64 (20171208_02:16)          | x86_64  | 82.21MB  | Dec 8, 2017 at 12:00am (UTC)  |
+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+
drunkard@thebar:~$
Am I supposed to know about "amd64" from the above somehow, and somehow know that a slash must precede it in the "images:" part of the lxc launch command?

Thanks,
bg
 
Old 12-10-2017, 08:47 AM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 2,445

Rep: Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001
I stopped using LXC a couple of years ago, but as I recall the image is a template location on the image server. In creating a new container you are installing from an image, which is automatically downloaded from the image server if it is not found on the local host. This is all covered, although not clearly, in the lxc/lxd documentation.

The Ubuntu folks seem to document mostly for people who do not care HOW it works, but only "how to do the next step" without knowing WHY. The information IS out there, but you may have to dig a little.
 
1 members found this post helpful.
Old 12-10-2017, 04:30 PM   #3
simosx
Member
 
Registered: Jul 2005
Posts: 37

Rep: Reputation: 3
Cool Container images and aliases

First of all, it is interesting to have a way to convert a host into a container.
The maintainer of LXD has a presentation for the FOSDEM conference that talks about that.

Second, to get the raw documentation, look into https://github.com/lxc/lxd/tree/master/doc

For your question, there are two official amd64 images for Centos in the images: repository,
Code:
| centos/6 (3 more)               | 84e21ff4a00f | yes    | Centos 6 amd64 (20171210_02:16)          | x86_64  | 75.58MB  | Dec 10, 2017 at 12:00am (UTC) |
| centos/7 (3 more)               | 007272ac2dde | yes    | Centos 7 amd64 (20171210_02:16)          | x86_64  | 82.22MB  | Dec 10, 2017 at 12:00am (UTC) |
Their respective names are centos/6 and centos/7. Each have 3 more aliases (not shown yet), and also have a fingerprint (the 84e21ff4a00f) that you can use instead.
Let's figure out those aliases.

Code:
$ lxc image info images:centos/6
Fingerprint: 84e21ff4a00f04c1e9eb2ad126f9de980d6eb00ec5e5f993da5b65680dcacd7d
Size: 75.58MB
Architecture: x86_64
Public: yes
Timestamps:
    Created: 2017/12/10 00:00 UTC
    Uploaded: 2017/12/10 00:00 UTC
    Expires: never
    Last used: never
Properties:
    architecture: amd64
    serial: 20171210_02:16
    description: Centos 6 amd64 (20171210_02:16)
    os: Centos
    release: 6
Aliases:
    - centos/6/default
    - centos/6/default/amd64
    - centos/6
    - centos/6/amd64
Cached: no
Auto update: disabled
Therefore, the following are all equivalent,
Code:
lxc launch images:centos/6
lxc launch images:centos/6/default
lxc launch images:centos/6/default/amd64
lxc launch images:centos/6/amd64
lxc launch images:84e21ff4a00f
lxc launch images:84e21ff4a00f04c1e9eb2ad126f9de980d6eb00ec5e5f993da5b65680dcacd7d
You can see that amd64 is the default, and if you do not want the default, you need to specify i386.

You can see more about what to do with LXD images at https://stgraber.org/2016/03/30/lxd-...anagement-512/
You can use a container image as a base to make your own image and so on.

Full documentation for the images and how they were created, at https://us.images.linuxcontainers.org/

You may want to have a look at the LXD forum, at https://discuss.linuxcontainers.org/
 
1 members found this post helpful.
Old 12-10-2017, 07:55 PM   #4
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221

Original Poster
Rep: Reputation: 36
The lxc image info command was what I missed. Thanks for both of you for your responses!
 
  


Reply

Tags
centos, lxc, rhel


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "lxc list" vs "lxc-ls" yknivag Linux - Virtualization and Cloud 1 03-09-2017 06:53 AM
How could a computer technician use the "top" command with "ps" and "kill" to investigate how a system is misbehaving? geckono1 Linux - Newbie 13 07-03-2016 08:51 AM
Centos Server Failed @ Bootup: Missing "/sbin/blkid" & "fsck" command not found beagle7 Linux - Newbie 4 08-24-2012 02:33 AM
Launch "Open With..." dialog from command line? BuilderQ Linux - Software 2 07-29-2008 10:49 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 11:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration