This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpre-config.sh
82 lines (68 loc) · 2.16 KB
/
pre-config.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
function log {
echo -e "[INFO] $1"
}
function logerr {
echo -e "[ERRO] $1"
}
FREE5GC_COMPOSE_REPO='https://github.com/free5gc/free5gc-compose.git'
DOCKER_COMPOSE_VERSION='1.29.2'
VAGRANT_UID='1000'
SYNCED_FOLDER='/vagrant'
WORKSPACE='free5gc-compose'
log "Start pre-config script"
log "Set environment variables"
export DEBIAN_FRONTEND=noninteractive
log "Install dependencies"
apt-get update -qq \
&& apt-get install -qq \
git \
build-essential \
vim \
strace \
net-tools \
iputils-ping \
iproute2
log "Update kernel version: 5.0.0-23-generic"
apt-get install -qq \
linux-image-5.0.0-23-generic \
linux-modules-5.0.0-23-generic \
linux-headers-5.0.0-23-generic \
&& grub-set-default 1 \
&& update-grub
log "Install latest version of docker"
apt-get remove -qq \
docker \
docker-engine \
docker.io \
containerd \
runc \
&& apt-get install -qq \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - &> /dev/null \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& apt-get update -qq \
&& apt-get install -qq \
docker-ce \
docker-ce-cli \
containerd.io \
&& groupadd docker | true \
&& usermod -aG docker $(id -nu $VAGRANT_UID) \
&& setfacl -m user:$(id -nu $VAGRANT_UID):rw /var/run/docker.sock \
&& systemctl enable docker \
log "Verify docker install"
docker --version
log "Install docker-compose version: $DOCKER_COMPOSE_VERSION"
curl -sL "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
&& chmod +x /usr/local/bin/docker-compose \
&& curl -L https://raw.githubusercontent.com/docker/compose/$DOCKER_COMPOSE_VERSION/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
log "Verify docker-compose install"
docker-compose --version
mkdir -p $SYNCED_FOLDER/$WORKSPACE
log "Git clone free5gc-compose project"
git clone $FREE5GC_COMPOSE_REPO $SYNCED_FOLDER/$WORKSPACE
log "End pre-config script. Reload the box.."