Skip to content

Commit 3e37742

Browse files
authored
Merge pull request #507 from dappnode/3alpha/move-docker-to-repo-install
Move Docker install to Docker repo
2 parents 579b12b + 1c6f545 commit 3e37742

5 files changed

Lines changed: 35 additions & 91 deletions

File tree

‎README.md‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ DAppNode is empowering people by creating a simple, transparent system for hosti
3535

3636
## Discover DAppNode
3737

38-
DAppNode lowers the barrier of entry for non tech-savy participants. It allows you to deploy, update, and manage P2P clients and nodes without leaving your browser. No terminal or command line interface.
38+
DAppNode lowers the barrier of entry for non tech-savvy participants. It allows you to deploy, update, and manage P2P clients and nodes without leaving your browser. No terminal or command line interface.
3939

4040
<p align="center">
4141
<a href="https://install.dappnode.io">
@@ -45,7 +45,7 @@ DAppNode lowers the barrier of entry for non tech-savy participants. It allows y
4545

4646
## Develop with DAppNode
4747

48-
DAppNode modular architecture allows any team to or project to publish a dockerized application to the DAppNode packages eco-system. Benefit from an enthusiatic crypto savy user based and offer a user interface-only experience to lower onboarding friction.
48+
DAppNode modular architecture allows any team to or project to publish a dockerized application to the DAppNode packages eco-system. Benefit from an enthusiastic crypto savvy user based and offer a user interface-only experience to lower onboarding friction.
4949

5050
Check out the [DAppNodeSDK](https://github.com/dappnode/DAppNodeSDK) to learn how to get started.
5151

@@ -123,7 +123,7 @@ Get your DAppNode and start contributing to decentralization by running your own
123123

124124
### Install DAppNode with ISO
125125

126-
DAppNode ISO available in: [latest DAppNode release](https://github.com/dappnode/DAppNode/releases)
126+
DAppNode ISO available is in: [latest DAppNode release](https://github.com/dappnode/DAppNode/releases).
127127

128128
Install DAppNode on your host machine by burning DAppNode ISO to a DVD or creating a bootable USB. Follow the tutorial of your operating system below and come back when you are finished:
129129

@@ -150,13 +150,13 @@ _Note_: ISO could be generated as unattended/attended by editing the env var ava
150150

151151
### Install DAppNode with scripts
152152

153-
Scripts available in: [latest DAppNode release](https://github.com/dappnode/DAppNode/releases)
153+
Scripts are available in: [latest DAppNode release](https://github.com/dappnode/DAppNode/releases).
154154

155-
DAppNode could be also installed on a host machine with an OS already running on it. DAppNode has been developed and configured to be run on debian host machines so is preferably to install DAppNode on Debian or debian based (like Ubuntu) host machines.
155+
DAppNode could be also installed on a host machine with an OS already running on it. DAppNode has been developed and configured to be run on Debian host machines. Therefore, it should work on Debian or Debian based (like Ubuntu) host machines. Minimum recommended Debian version is 11.
156156

157-
**1. Prerrequisites**
157+
**1. Prerequisites**
158158

159-
Before install DAppNode with the script option, make sure you fullfill the requirements by running the following script:
159+
Before installing DAppNode with the script option, make sure you fulfill the requirements by running the following script:
160160

161161
```bash
162162
sudo wget -O - https://prerequisites.dappnode.io | sudo bash
@@ -172,7 +172,7 @@ sudo wget -O - https://installer.dappnode.io | sudo bash
172172

173173
**3. Uninstall DAppNode**
174174

175-
Uinstall DAppNode on your host machine by running the following command:
175+
Uninstall DAppNode from your host machine by running the following command:
176176

177177
```bash
178178
wget -qO - https://uninstaller.dappnode.io | sudo bash
@@ -188,7 +188,7 @@ sudo wget -O - https://installer.dappnode.io | sudo UPDATE=true bash
188188

189189
## Releases
190190

191-
Create releases manually with github actions, the github action to run is: **Pre-release**. Requirements are:
191+
Create releases manually with Github actions, the Github action to run is: **Pre-release**. The requirements are:
192192

193193
- Introduce the core packages versions
194194
- There must exist the corresponding core package release for the specified version
@@ -206,15 +206,15 @@ The release will contain:
206206

207207
## Testing with artifacts
208208

209-
Generate ISOs and test them by running the github action: **Artifacts**. This action will generate an artifacts with the same assets as the release, useful for testing purposes.
209+
Generate ISOs and test them by running the Github action: **Artifacts**. This action will generate an artifacts with the same assets as the release, useful for testing purposes.
210210

211211
## Versioning
212212

213213
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/dappnode/DAppNode/tags).
214214

215215
## Team members
216216

217-
Members of the [White Hat Group (WHG)](https://motherboard.vice.com/en_us/article/qvp5b3/how-ethereum-coders-hacked-back-to-rescue-dollar208-million-in-ethereum) have spent countless hours boostraping and developing DAppNode in 2017. Currently, the project is mantained by a growing multi-disciplary team:
217+
Members of the [White Hat Group (WHG)](https://motherboard.vice.com/en_us/article/qvp5b3/how-ethereum-coders-hacked-back-to-rescue-dollar208-million-in-ethereum) have spent countless hours bootstrapping and developing DAppNode in 2017. Currently, the project is maintained by a growing multi-disciplinary team:
218218

219219
- **Adviser & Instigator:** Jordi Baylina
220220
- **Project Lead:** Eduadiez

‎iso/preseeds/preseed.cfg‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ d-i preseed/late_command string \
3535
in-target mkdir -p /usr/src/dappnode; \
3636
cp -ar /cdrom/dappnode/* /target/usr/src/dappnode/; \
3737
cp -a /cdrom/dappnode/scripts/rc.local /target/etc/rc.local; \
38-
cp -a /cdrom/dappnode/bin/docker/docker-compose-Linux-x86_64 /target/usr/local/bin/docker-compose; \
3938
in-target chmod +x /usr/src/dappnode/scripts/dappnode_install_pre.sh; \
4039
in-target chmod +x /usr/src/dappnode/scripts/static_ip.sh; \
41-
in-target chmod +x /usr/local/bin/docker-compose; \
4240
in-target gpasswd -a $(getent passwd "1000" | cut -d: -f1) sudo; \
4341
/target/usr/src/dappnode/scripts/static_ip.sh; \
4442
in-target /usr/src/dappnode/scripts/dappnode_install_pre.sh UPDATE

‎iso/preseeds/preseed_unattended.cfg‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ d-i preseed/late_command string \
7575
cp -a /etc/network/interfaces /target/etc/network/interfaces; \
7676
cp -ar /cdrom/dappnode/* /target/usr/src/dappnode/; \
7777
cp -a /cdrom/dappnode/scripts/rc.local /target/etc/rc.local; \
78-
cp -a /cdrom/dappnode/bin/docker/docker-compose-Linux-x86_64 /target/usr/local/bin/docker-compose; \
7978
in-target chmod +x /usr/src/dappnode/scripts/dappnode_install_pre.sh; \
80-
in-target chmod +x /usr/local/bin/docker-compose; \
8179
in-target touch /usr/src/dappnode/.firstboot; \
8280
in-target /usr/src/dappnode/scripts/dappnode_install_pre.sh UPDATE
8381
d-i finish-install/reboot_in_progress note

‎iso/scripts/generate_dappnode_iso_debian.sh‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,11 @@ echo "Downloading third-party packages..."
3838
sed '1,/^\#\!ISOBUILD/!d' /usr/src/app/scripts/dappnode_install_pre.sh >/tmp/vars.sh
3939
# shellcheck disable=SC1091
4040
source /tmp/vars.sh
41-
mkdir -p /images/bin/docker
42-
cd /images/bin/docker
43-
[ -f "${DOCKER_PKG}" ] || wget "${DOCKER_URL}"
44-
[ -f "${DOCKER_CLI_PKG}" ] || wget "${DOCKER_CLI_URL}"
45-
[ -f "${CONTAINERD_PKG}" ] || wget "${CONTAINERD_URL}"
46-
[ -f docker-compose-linux-x86_64 ] || wget "${DCMP_URL}"
47-
cd - # /usr/src/app/dappnode-iso
4841

4942
echo "Creating necessary directories and copying files..."
5043
mkdir -p /usr/src/app/dappnode-iso/dappnode
5144
cp -r /usr/src/app/scripts /usr/src/app/dappnode-iso/dappnode
5245
cp -r /usr/src/app/dappnode/* /usr/src/app/dappnode-iso/dappnode
53-
cp -vr /images/bin /usr/src/app/dappnode-iso/dappnode/
5446

5547
echo "Customizing preseed..."
5648
mkdir -p /tmp/makeinitrd

‎scripts/dappnode_install_pre.sh‎

Lines changed: 24 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,8 @@
44

55
DAPPNODE_DIR="/usr/src/dappnode"
66
LOGS_DIR="$DAPPNODE_DIR/logs"
7-
DOCKER_PKG="docker-ce_20.10.6~3-0~debian-bullseye_amd64.deb"
8-
DOCKER_CLI_PKG="docker-ce-cli_20.10.6~3-0~debian-bullseye_amd64.deb"
9-
CONTAINERD_PKG="containerd.io_1.4.4-1_amd64.deb"
10-
DOCKER_REPO="https://download.docker.com/linux/debian/dists/bullseye/pool/stable/amd64"
11-
DOCKER_PATH="${DAPPNODE_DIR}/bin/docker/${DOCKER_PKG}"
12-
DOCKER_CLI_PATH="${DAPPNODE_DIR}/bin/docker/${DOCKER_CLI_PKG}"
13-
CONTAINERD_PATH="${DAPPNODE_DIR}/bin/docker/${CONTAINERD_PKG}"
14-
DCMP_PATH="/usr/local/bin/docker-compose"
15-
DOCKER_URL="${DOCKER_REPO}/${DOCKER_PKG}"
16-
DOCKER_CLI_URL="${DOCKER_REPO}/${DOCKER_CLI_PKG}"
17-
CONTAINERD_URL="${DOCKER_REPO}/${CONTAINERD_PKG}"
18-
DCMP_URL="https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-x86_64"
19-
WGET="wget -q --show-progress --progress=bar:force"
7+
lsb_dist="$(. /etc/os-release && echo "$ID")"
8+
209

2110
#!ISOBUILD Do not modify, variables above imported for ISO build
2211

@@ -31,48 +20,24 @@ detect_installation_type() {
3120
fi
3221
}
3322

34-
# DOCKER INSTALLATION
35-
install_docker() {
36-
# STEP 0: Detect if it's a Debian 9 (stretch) or Debian 10 (Buster) installation
37-
# ----------------------------------------
38-
if [ -f "/etc/os-release" ] && grep -q "buster" "/etc/os-release"; then
39-
DOCKER_PKG="docker-ce_20.10.2~3-0~debian-buster_amd64.deb"
40-
DOCKER_CLI_PKG="docker-ce-cli_20.10.2~3-0~debian-buster_amd64.deb"
41-
CONTAINERD_PKG="containerd.io_1.4.3-1_amd64.deb"
42-
DOCKER_REPO="https://download.docker.com/linux/debian/dists/buster/pool/stable/amd64"
43-
DOCKER_PATH="${DAPPNODE_DIR}/bin/docker/${DOCKER_PKG}"
44-
DOCKER_CLI_PATH="${DAPPNODE_DIR}/bin/docker/${DOCKER_CLI_PKG}"
45-
CONTAINERD_PATH="${DAPPNODE_DIR}/bin/docker/${CONTAINERD_PKG}"
46-
DOCKER_URL="${DOCKER_REPO}/${DOCKER_PKG}"
47-
DOCKER_CLI_URL="${DOCKER_REPO}/${DOCKER_CLI_PKG}"
48-
CONTAINERD_URL="${DOCKER_REPO}/${CONTAINERD_PKG}"
49-
elif [ -f "/etc/os-release" ] && grep -q "stretch" "/etc/os-release"; then
50-
DOCKER_PKG="docker-ce_19.03.8~3-0~debian-stretch_amd64.deb"
51-
DOCKER_CLI_PKG="docker-ce-cli_19.03.8~3-0~debian-stretch_amd64.deb"
52-
CONTAINERD_PKG="containerd.io_1.2.6-3_amd64.deb"
53-
DOCKER_REPO="https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64"
54-
DOCKER_PATH="${DAPPNODE_DIR}/bin/docker/${DOCKER_PKG}"
55-
DOCKER_CLI_PATH="${DAPPNODE_DIR}/bin/docker/${DOCKER_CLI_PKG}"
56-
CONTAINERD_PATH="${DAPPNODE_DIR}/bin/docker/${CONTAINERD_PKG}"
57-
DOCKER_URL="${DOCKER_REPO}/${DOCKER_PKG}"
58-
DOCKER_CLI_URL="${DOCKER_REPO}/${DOCKER_CLI_PKG}"
59-
CONTAINERD_URL="${DOCKER_REPO}/${CONTAINERD_PKG}"
60-
fi
6123

62-
# STEP 1: Download files
63-
# ----------------------------------------
64-
[ -f $DOCKER_PATH ] || $WGET -O $DOCKER_PATH $DOCKER_URL
65-
[ -f $DOCKER_CLI_PATH ] || $WGET -O $DOCKER_CLI_PATH $DOCKER_CLI_URL
66-
[ -f $CONTAINERD_PATH ] || $WGET -O $CONTAINERD_PATH $CONTAINERD_URL
24+
add_docker_repo() {
25+
apt-get update -y
26+
apt-get remove -y docker docker-engine docker.io containerd runc | tee -a $LOG_FILE
27+
apt-get install -y ca-certificates curl gnupg lsb-release | tee -a $LOG_FILE
28+
mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings
29+
curl -fsSL "https://download.docker.com/linux/${lsb_dist}/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
30+
chmod a+r /etc/apt/keyrings/docker.gpg
31+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$lsb_dist $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
32+
}
6733

68-
# STEP 2: Install packages
69-
# ----------------------------------------
70-
dpkg -i $CONTAINERD_PATH 2>&1 | tee -a $LOG_FILE
71-
dpkg -i $DOCKER_CLI_PATH 2>&1 | tee -a $LOG_FILE
72-
dpkg -i $DOCKER_PATH 2>&1 | tee -a $LOG_FILE
34+
# DOCKER INSTALLATION
35+
install_docker() {
36+
apt-get update -y
37+
apt-get install -y docker-ce docker-ce-cli containerd.io | tee -a $LOG_FILE
7338

7439
# Ensure xz is installed
75-
[ -f "/usr/bin/xz" ] || (apt-get update -y && apt-get install -y xz-utils)
40+
[ -f "/usr/bin/xz" ] || ( apt-get install -y xz-utils)
7641

7742
USER=$(grep 1000 "/etc/passwd" | cut -f 1 -d:)
7843
[ -z "$USER" ] || usermod -aG docker "$USER"
@@ -91,18 +56,7 @@ install_docker() {
9156

9257
# DOCKER COMPOSE INSTALLATION
9358
install_docker_compose() {
94-
# STEP 0: Declare paths and directories
95-
# ----------------------------------------
96-
97-
# Ensure paths exist
98-
mkdir -p "$(dirname "$DCMP_PATH")" 2>&1 | tee -a $LOG_FILE
99-
100-
# STEP 1: Download files
101-
# ----------------------------------------
102-
103-
[ -f $DCMP_PATH ] || $WGET -O $DCMP_PATH $DCMP_URL
104-
# Give permissions
105-
chmod +x $DCMP_PATH 2>&1 | tee -a $LOG_FILE
59+
apt-get install -y docker-compose | tee -a $LOG_FILE
10660

10761
# Disable check if ISO installation since it is not possible to check in this way
10862
if [ "$ISO_INSTALLATION" = "false" ]; then
@@ -119,10 +73,6 @@ install_docker_compose() {
11973
# WIREGUARD INSTALLATION
12074
install_wireguard_dkms() {
12175
apt-get update -y
122-
if [ -f "/etc/os-release" ] && grep -q "buster" "/etc/os-release"; then
123-
echo "deb http://deb.debian.org/debian/ buster-backports main" > /etc/apt/sources.list.d/buster-backports.list
124-
printf 'Package: *\nPin: release a=buster-backports\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-backports
125-
fi
12676

12777
apt-get install wireguard-dkms -y | tee -a $LOG_FILE
12878

@@ -170,7 +120,6 @@ detect_installation_type
170120
# Ensure paths exist
171121
mkdir -p $DAPPNODE_DIR
172122
mkdir -p $LOGS_DIR
173-
mkdir -p "$(dirname "$DOCKER_PATH")"
174123

175124
touch $LOG_FILE
176125

@@ -180,6 +129,13 @@ if [ "$1" == "UPDATE" ]; then
180129
host_update 2>&1 | tee -a $LOG_FILE
181130
fi
182131

132+
133+
if find /etc/apt/ -name "*.list" -print0 | xargs --null cat | grep -q "https://download.docker.com/linux/$lsb_dist" ; then
134+
echo -e "\e[32m \n\n docker repo is already added \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
135+
else
136+
add_docker_repo | tee -a $LOG_FILE
137+
fi
138+
183139
# Only install docker if needed
184140
if docker -v >/dev/null 2>&1; then
185141
echo -e "\e[32m \n\n docker is already installed \n\n \e[0m" 2>&1 | tee -a $LOG_FILE

0 commit comments

Comments
 (0)