-
Notifications
You must be signed in to change notification settings - Fork 0
/
runme.sh
executable file
·29 lines (20 loc) · 925 Bytes
/
runme.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
printf "\nBuilding systemd container\n"
docker build -q -t centos7_systemd .
printf "\nRunning the systemd container\n"
docker run -d --privileged --name centos7_systemd -ti -e container=docker -v /sys/fs/cgroup:/sys/fs/cgroup centos7_systemd /usr/sbin/init
printf "\nCopying across the vm image\n"
docker cp CentOS-7-x86_64-GenericCloud-1711.qcow2 centos7_systemd:/
printf "\nCopying across the the convert script\n"
docker cp ./script.sh centos7_systemd:/
printf "\nRunning the convert script\n"
docker -l error exec -it centos7_systemd /script.sh
printf "\nTakeing completed converted file from container\n"
docker cp centos7_systemd:/centos7.tgz .
printf "\nStopping and removing systemd docker image\n"
docker -l error stop centos7_systemd
docker -l error rm centos7_systemd
docker rmi centos7_systemd
printf "\nImport new image into docker\n"
docker import centos7.tgz test
printf "\nAll done.\n"