Linux technical support - [email protected]


lxc

# SHOW CONTAINER IP
lxc-info -n name -iH

# CREATE CONTAINER
lxc-create -t download -n u1 -- --dist centos --release 7 --arch amd64

# START, STOP CONTAINER
lxc-start -n name -d
lxc-stop -n name

# SHOW ACTIVE
lxc-ls --active

# CONNECT WITH CONSOLE
lxc-console -n name

# REDIRECT PORT
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 9090 -j DNAT --to 192.168.122.98

# AUTOSTART CONTAINER
lxc.start.auto = 1

# RESOURCE LIMITS
lxc.cgroup.memory.limit_in_bytes = 512M
lxc.cgroup.memory.memsw.limit_in_bytes = 1G

# ALLOW DOCKER
lxc.apparmor.profile = unconfined
lxc.cgroup.devices.allow = a

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>