Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P217
(An Untitled Masterwork)
Active
Public
Actions
Authored by
seirl
on Jan 26 2018, 3:48 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
root@swh-test:~# cat setup_container.sh
#!/bin/bash
set
-e
CONTAINER_NAME
=
orangeriedev
cd
/var/lib/machines
apt install debootstrap systemd-container
if
[
! -d
"
$CONTAINER_NAME
"
]
;
then
debootstrap stable
"
$CONTAINER_NAME
"
http://deb.debian.org/debian/
systemd-nspawn -D
"
$CONTAINER_NAME
"
/usr/bin/passwd
systemd-nspawn -D
"
$CONTAINER_NAME
"
apt install dbus
echo
"
$CONTAINER_NAME
"
>
"
$CONTAINER_NAME
/etc/hostname"
fi
mkdir -p /etc/systemd/nspawn
cat >/etc/systemd/nspawn/
"
$CONTAINER_NAME
"
.nspawn
<<EOF
[Exec]
Boot=yes
[Files]
Bind=/mnt/$CONTAINER_NAME:/srv/softwareheritage
[Network]
Private=off
#VirtualEthernet=on
#Port=5005
EOF
systemctl daemon-reload
systemctl
enable
--now systemd-nspawn@
"
$CONTAINER_NAME
"
.service
systemctl
enable
machines.target
Event Timeline
seirl
created this paste.
Jan 26 2018, 3:48 PM
2018-01-26 15:48:49 (UTC+1)
Log In to Comment