Skip to content

Commit f2b4ddb

Browse files
Use new docker compose (#639)
* use docker compose instead of docker-compose * update debian image
1 parent 198cf87 commit f2b4ddb

File tree

5 files changed

+32
-36
lines changed

5 files changed

+32
-36
lines changed

.github/workflows/artifacts.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ jobs:
7272
- name: Build attended
7373
run: |
7474
sed -i -e "/UNATTENDED/s/true/false/" docker-compose.yml
75-
docker-compose build
76-
docker-compose up
75+
docker compose build
76+
docker compose up
7777
7878
# Verify ISO attended created
7979
- name: Check iso attended
@@ -89,8 +89,8 @@ jobs:
8989
- name: Build unattended
9090
run: |
9191
sed -i -e "/UNATTENDED/s/false/true/" docker-compose.yml
92-
docker-compose build
93-
docker-compose up
92+
docker compose build
93+
docker compose up
9494
9595
# Verify ISO unattended was created
9696
- name: Check iso unattended

.github/workflows/release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ jobs:
7272
- name: Build attended
7373
run: |
7474
sed -i -e "/UNATTENDED/s/true/false/" docker-compose.yml
75-
docker-compose build
76-
docker-compose up
75+
docker compose build
76+
docker compose up
7777
7878
# Verify ISO attended created
7979
- name: Check iso attended
@@ -89,8 +89,8 @@ jobs:
8989
- name: Build unattended
9090
run: |
9191
sed -i -e "/UNATTENDED/s/false/true/" docker-compose.yml
92-
docker-compose build
93-
docker-compose up
92+
docker compose build
93+
docker compose up
9494
9595
# Verify ISO unattended was created
9696
- name: Check iso unattended

Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ FROM docker:dind
22
# hadolint ignore=DL3018
33
RUN apk update && \
44
apk add --no-cache xorriso git xz curl ca-certificates iptables cpio bash perl-utils \
5-
docker-compose && \
65
rm -rf /var/cache/apk/*
76

87
#RUN apk add -U --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing aufs-util

iso/scripts/generate_dappnode_iso_debian.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
set -e
33

44
# Source = https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.5.0-amd64-netinst.iso
5-
ISO_NAME=debian-12.5.0-amd64-netinst.iso
5+
ISO_NAME=debian-12.7.0-amd64-netinst.iso
66
ISO_PATH="/images/${ISO_NAME}"
77
ISO_URL=https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/
8-
SHASUM="013f5b44670d81280b5b1bc02455842b250df2f0c6763398feb69af1a805a14f ${ISO_PATH}"
8+
SHASUM="8fde79cfc6b20a696200fc5c15219cf6d721e8feb367e9e0e33a79d1cb68fa83 ${ISO_PATH}"
99

1010
echo "Downloading debian ISO image: ${ISO_NAME}..."
1111
if [ ! -f ${ISO_PATH} ]; then

scripts/dappnode_install_pre.sh

+22-25
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ DAPPNODE_DIR="/usr/src/dappnode"
66
LOGS_DIR="$DAPPNODE_DIR/logs"
77
lsb_dist="$(. /etc/os-release && echo "$ID")"
88

9-
109
#!ISOBUILD Do not modify, variables above imported for ISO build
1110

1211
detect_installation_type() {
@@ -20,24 +19,23 @@ detect_installation_type() {
2019
fi
2120
}
2221

23-
2422
add_docker_repo() {
2523
apt-get update -y
2624
apt-get remove -y docker docker-engine docker.io containerd runc | tee -a $LOG_FILE
2725
apt-get install -y ca-certificates curl gnupg lsb-release | tee -a $LOG_FILE
2826
mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings
2927
curl -fsSL "https://download.docker.com/linux/${lsb_dist}/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
3028
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
29+
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
3230
}
3331

3432
# DOCKER INSTALLATION
3533
install_docker() {
3634
apt-get update -y
37-
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin | tee -a $LOG_FILE
35+
apt-get install -y docker-ce docker-ce-cli containerd.io | tee -a $LOG_FILE
3836

3937
# Ensure xz is installed
40-
[ -f "/usr/bin/xz" ] || ( apt-get install -y xz-utils)
38+
[ -f "/usr/bin/xz" ] || (apt-get install -y xz-utils)
4139

4240
USER=$(grep 1000 "/etc/passwd" | cut -f 1 -d:)
4341
[ -z "$USER" ] || usermod -aG docker "$USER"
@@ -56,50 +54,50 @@ install_docker() {
5654

5755
# DOCKER-COMPOSE FOR LEGACY SCRIPTS, SHOULD BE REMOVED EVENTUALLY
5856
alias_docker_compose() {
59-
cat > /usr/local/bin/docker-compose<<EOL
57+
cat >/usr/local/bin/docker-compose <<EOL
6058
#!/bin/bash
6159
docker compose "\$@"
6260
EOL
6361
chmod +x /usr/local/bin/docker-compose
6462
}
6563

66-
# WIREGUARD INSTALLATION
64+
# WIREGUARD INSTALLATION
6765
install_wireguard_dkms() {
6866
apt-get update -y
6967

7068
apt-get install wireguard-dkms -y | tee -a $LOG_FILE
7169

72-
if modprobe wireguard >/dev/null 2>&1 ; then
70+
if modprobe wireguard >/dev/null 2>&1; then
7371
echo -e "\e[32m \n\n Verified wiregurd-dkms installation \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
7472
else
7573
echo -e "\e[31m \n\n WARNING: wireguard kernel module is not installed, Wireguard DAppNode package might not work! \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
7674
fi
7775
}
7876

79-
# LSOF INSTALLATION: used to scan host port 80 in use, https package installation will deppend on it
77+
# LSOF INSTALLATION: used to scan host port 80 in use, https package installation will deppend on it
8078
install_lsof() {
8179
apt-get update -y
8280
apt-get install lsof -y | tee -a $LOG_FILE
83-
if lsof -v >/dev/null 2>&1 ; then
81+
if lsof -v >/dev/null 2>&1; then
8482
echo -e "\e[32m \n\n Verified lsof installation \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
8583
else
8684
echo -e "\e[31m \n\n WARNING: lsof not installed, HTTPS DAppNode package might not be installed! \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
8785
fi
8886
}
8987

9088
# IPTABLES INSTALLATION: mandatory for docker, on bullseye is not installed by default
91-
install_iptables () {
89+
install_iptables() {
9290
apt-get update -y
9391
apt-get install iptables -y | tee -a $LOG_FILE
94-
if iptables -v >/dev/null 2>&1 ; then
92+
if iptables -v >/dev/null 2>&1; then
9593
echo -e "\e[32m \n\n Verified iptables installation \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
9694
else
9795
echo -e "\e[31m \n\n WARNING: iptables not installed, Docker may not work! \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
9896
fi
9997
}
10098

10199
# HOST UPDATE
102-
host_update () {
100+
host_update() {
103101
apt-get update 2>&1 | tee -a $LOG_FILE
104102
apt-get -y upgrade 2>&1 | tee -a $LOG_FILE
105103
}
@@ -122,8 +120,7 @@ if [ "$1" == "UPDATE" ]; then
122120
host_update 2>&1 | tee -a $LOG_FILE
123121
fi
124122

125-
126-
if find /etc/apt/ -name "*.list" -print0 | xargs --null cat | grep -q "https://download.docker.com/linux/$lsb_dist" ; then
123+
if find /etc/apt/ -name "*.list" -print0 | xargs --null cat | grep -q "https://download.docker.com/linux/$lsb_dist"; then
127124
echo -e "\e[32m \n\n docker repo is already added \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
128125
else
129126
add_docker_repo | tee -a $LOG_FILE
@@ -136,15 +133,8 @@ else
136133
install_docker 2>&1 | tee -a $LOG_FILE
137134
fi
138135

139-
# Only install docker-compose if needed
140-
if docker-compose -v >/dev/null 2>&1; then
141-
echo -e "\e[32m \n\n docker-compose is already aliased \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
142-
else
143-
alias_docker_compose 2>&1 | tee -a $LOG_FILE
144-
fi
145-
146136
# Only install wireguard-dkms if needed
147-
if modprobe wireguard >/dev/null 2>&1 ; then
137+
if modprobe wireguard >/dev/null 2>&1; then
148138
echo -e "\e[32m \n\n wireguard-dkms is already installed \n\n \e[0m" 2>&1 | tee -a $LOG_FILE
149139
else
150140
install_wireguard_dkms 2>&1 | tee -a $LOG_FILE
@@ -158,15 +148,22 @@ else
158148
fi
159149

160150
#Check connectivity
161-
{ [ -f /etc/network/interfaces ] && grep "iface en.* inet dhcp" /etc/network/interfaces &>/dev/null; } || { echo "Interfaces not found"; exit 1; }
151+
{ [ -f /etc/network/interfaces ] && grep "iface en.* inet dhcp" /etc/network/interfaces &>/dev/null; } || {
152+
echo "Interfaces not found"
153+
exit 1
154+
}
162155

163156
## Add missing interfaces
164157
if [ -f /usr/src/dappnode/hotplug ]; then
165158
# shellcheck disable=SC2013
166159
for IFACE in $(grep "en.*" /usr/src/dappnode/hotplug); do
167160
# shellcheck disable=SC2143
168161
if [[ $(grep -L "$IFACE" /etc/network/interfaces) ]]; then
169-
{ echo "# $IFACE"; echo "allow-hotplug $IFACE"; echo "iface $IFACE inet dhcp"; } >> /etc/network/interfaces
162+
{
163+
echo "# $IFACE"
164+
echo "allow-hotplug $IFACE"
165+
echo "iface $IFACE inet dhcp"
166+
} >>/etc/network/interfaces
170167
fi
171168
done
172169
fi

0 commit comments

Comments
 (0)