Last active
August 9, 2017 16:34
-
-
Save hvwaldow/01d78ef47d73640ebf945329b2c8a1c1 to your computer and use it in GitHub Desktop.
Setup for RDMO in LXC container (for development)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It is about a privileged container. Hostsystem: | |
Debian 4.6.4-1 (2016-07-18) x86_64 GNU/Linux (PRETTY_NAME="Debian GNU/Linux 9 (stretch)") | |
1. sudo lxc-create -t download -n <name> | |
2. Choose: | |
Distribution: debian | |
Release: stretch | |
Architecture: amd64 | |
This resulted in installation of the same base system than that of the host. | |
3. Add network configuration in var/lib/lxc/<name>/config: | |
lxc.network.type = veth | |
lxc.network.flags = up | |
lxc.network.link = lxcbr0 | |
lxc.network.ipv4 = 10.0.3.33/24 | |
lxc.network.ipv4.gateway = auto | |
The last 2 entries make the container think these are BIOS settings, | |
which will be honored by setting "iface eth0 inet manual" in the container's /etc/networking/interfaces. | |
4. sudo lxc-start -n rdmo | |
5. sudo lxc-attach -n rdmo | |
As root in container: | |
+ modify /etc/network/interfaces to: | |
auto lo | |
iface lo inet loopback | |
auto eth0 | |
iface eth0 inet manual | |
"manual" will make the container behave like it's BIOS already set up the interface and just use it. | |
Source: https://serverfault.com/a/586577 | |
# add <name> to 127.0.0.1 in /etc/hosts | |
# restart and attach again the container | |
# Install some basics | |
apt-get update | |
apt-get dist-upgrade | |
apt-get install openssh-server | |
apt-get install vim | |
apt-get install sudo | |
apt-get install curl | |
# Get rid of Perl-generated local-errors: | |
dpkg-reconfigure locales. Generate: | |
locale-gen en_US.utf8 | |
locale_gen en_DK.UTF-8 | |
locale-gen de_CH.utf8 | |
# make a user account (passwordless login, sudo) | |
# create ssh key-pair | |
# dependencies for RDMO | |
apt-get install build-essential libxml2-dev libxslt-dev zlib1g-dev | |
apt-get install python-dev python-pip python-virtualenv | |
apt-get install python3-dev | |
apt-get install git | |
apt-get install pandoc | |
# clone the repo | |
git clone https://github.com/rdmorganiser/rdmo.git | |
cd rdmo | |
# use python3 | |
virtualenv -p python3 env | |
. ./env/bin/activate | |
# install node using nodeenv (Debain package of node for Stretch is deprecated) | |
# At the moment it looks like node is not needed though. | |
pip install nodeenv | |
nodenv -p | |
# follow instructions at http://rdmo.readthedocs.io/en/latest/installation | |
# there are problems with using bower for the front-end components. Download the archive: | |
curl -L https://github.com/rdmorganiser/rdmo-components/archive/master.tar.gz |tar zxv | |
# Allow access while running under container IP. Edit rdmo/settings/local.py: | |
ALLOWED_HOSTS = ['localhost', '10.0.3.33'] | |
# start development server: | |
python manage.py runserver 0.0.0.0:8000 | |
# NEXT: | |
Install | |
bootstrap/dist/css/bootstrap.min.css | |
components-font-awesome/css/font-awesome.min.css | |
jquery/dist/jquery.min.js | |
bootstrap/dist/js/bootstrap.min.js | |
angular/angular.min.js | |
angular-resource/angular-resource.min.js | |
which apparently are missing. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment