Below command will host current directory as http server on specified port
Python2:
python -m SimpleHTTPServer <port_number>
python3:
python3 -m http.server <port_number>
Below command will host current directory as http server on specified port
Python2:
python -m SimpleHTTPServer <port_number>
python3:
python3 -m http.server <port_number>
What’s LXC?
– API to communicate with with LXD(Linux container)
What’s LXD?
– It’s like VM for Linux containers
yum -y install epel-release
yum -y install libvirt lxc lxc-templates libcap-devel libcgroup busybox wget bridge-utils lxc-extra
systemctl start libvirtd
systemctl enable libvirtd
[root@lxc01~]# lxc-checkconfig
Kernel configuration not found at /proc/config.gz; searching...
Kernel configuration found at /boot/config-3.10.0-862.el7.x86_64
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
newuidmap is not installed
newgidmap is not installed
Network namespace: enabled
Multiple /dev/pts instances: enabled
--- Control groups ---
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled
--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
Bridges: enabled
Advanced netfilter: enabled
CONFIG_NF_NAT_IPV4: enabled
CONFIG_NF_NAT_IPV6: enabled
CONFIG_IP_NF_TARGET_MASQUERADE: enabled
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled
--- Checkpoint/Restore ---
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
File capabilities: enabled
Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig
lxc-create -n centos7container -t centos
It will pull the centos container image from the internet and will use the centos template from /usr/share/lxc/templates/
lxc-start -n centos7container -d
[root@lxc01 ~]# lxc-ls
centos7container
[root@lxc01 ~]# lxc-ls --active
centos7container
lxc-attach -n centos7container
lxc-stop -n centos7container
lxc-destroy -n centos7container