Skip to content

Commit 3243fcd

Browse files
committed
Adapted basebox / dev VM to be usable for docker-compose and npm
* More RAM. * Install docker and npm dependencies * Small config change in /etc/sysctl.conf With these adaptations I am able to run npm builds and also docker-compose setups locally. Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
1 parent d467580 commit 3243fcd

2 files changed

Lines changed: 30 additions & 11 deletions

File tree

Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Vagrant.configure("2") do |config|
6868
# Doesn't work in libvirt:
6969
# dev.vm.network "private_network", ip: "fde4:8dba:82e1::c4"
7070
dev.vm.provider "virtualbox" do |v|
71-
v.memory = 2048
71+
v.memory = 16384
7272
v.cpus = 4
7373
v.customize ["modifyvm", :id, "--vram", "16"]
7474
end

basebox/bootstrap.sh

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function add_to_path {
2525

2626
# Install a bunch of packages noninteractively:
2727
export DEBIAN_FRONTEND=noninteractive
28-
apt-get update
28+
apt-get update -y
2929
apt-get upgrade -y
3030
apt-get install -y emacs git nano
3131
apt-get install -y ntp
@@ -37,30 +37,49 @@ apt-get install -y lmdb-utils liblmdb-dev libpam0g-dev flex
3737
apt-get install -y libtokyocabinet-dev
3838
apt-get install -y unzip
3939
apt-get install -y cargo
40-
apt-get install -y nodejs npm jq
41-
npm install --global json5
40+
apt-get install -y jq
4241

4342
# Nova deps:
4443
apt-get install -y postgresql-12 postgresql-contrib-12 # libpq-dev pgadmin3
4544
apt-get install -y libpgtypes3 libecpg-dev libldap2-dev
4645
apt-get install -y software-properties-common
4746
add-apt-repository -y ppa:ondrej/php
48-
apt-get update
47+
apt-get update -y
4948
apt-get install -y --force-yes php7.3-dev
5049

51-
source /etc/os-release
52-
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
53-
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
54-
apt-get update
55-
apt-get -y install podman buildah
56-
5750
# mingw cross compile deps:
5851
apt-get install -y dpkg-dev debhelper g++ libncurses5 pkg-config build-essential libpam0g-dev mingw-w64
5952

53+
# source /etc/os-release
54+
# echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
55+
# curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
56+
# apt-get update
57+
# apt-get -y install podman buildah
58+
59+
apt-get install -y ca-certificates curl gnupg
60+
install -m 0755 -d /etc/apt/keyrings
61+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
62+
chmod a+r /etc/apt/keyrings/docker.gpg
63+
echo \
64+
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
65+
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
66+
tee /etc/apt/sources.list.d/docker.list > /dev/null
67+
apt-get -y update
68+
apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
69+
70+
apt-get purge nodejs
71+
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
72+
apt-get install -y nodejs
73+
74+
npm install --global json5
75+
6076
# Remove unneeded packages and cache:
6177
apt-get -y autoremove
6278
apt-get -y clean
6379

80+
echo "vm.max_map_count=262144" >> /etc/sysctl.conf
81+
sudo sysctl -p
82+
6483
mkdir -p /home/vagrant/.ssh
6584
cp /vagrant/keys/insecure.pub /home/vagrant/.ssh/id_rsa.pub
6685
cp /vagrant/keys/insecure /home/vagrant/.ssh/id_rsa

0 commit comments

Comments
 (0)