Skip to content

Conversation

@dappnodedev
Copy link
Contributor

This PR aims to provide a new dappnode ISO image based on Ubuntu, instead of Debian

@dappnodedev dappnodedev requested a review from a team as a code owner June 10, 2024 14:11
install_docker() {
apt-get update -y
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin | tee -a $LOG_FILE
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | tee -a $LOG_FILE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add buildx-plugin? does ubuntu need it and debian doesnt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script dappnode_install_pre is executed both in Debian and Ubuntu. I added it because it is recommended here: https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository and we also use it to build packages for several architectures

[ -f "/usr/bin/xz" ] || ( apt-get install -y xz-utils)
[ -f "/usr/bin/xz" ] || (apt-get install -y xz-utils)

# Not working in Ubuntu ISO because the user is not created before executing late-commands
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is not working in ubuntu and has to be done in dappnode_install.sh, shouldnt we only add user in docker group only if NOT in ubuntu? to avoid unnecessary warning or errors

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Ubuntu it will just not be executed because the user with ID 1000 does not exist yet.

fi

echo -e "\e[32mAdding user to docker group...\e[0m" 2>&1 | tee -a $LOGFILE
addUserToDockerGroup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if all distros (debian, ubuntu..) call addUserToDockerGroup() here, we can remove it from dappnode_install_pre.sh right?

- name: Get SHA-256 Debian attended
id: shasum-ubuntu-attended
run: |
echo -en "# Versions\n| Package | Version |\n|---|---|\nbind.dnp.dappnode.eth|${BIND_VERSION}|\n|ipfs.dnp.dappnode.eth|${IPFS_VERSION}|\n|vpn.dnp.dappnode.eth |${VPN_VERSION}|\n|dappmanager.dnp.dappnode.eth|${DAPPMANAGER_VERSION}|\n|wifi.dnp.dappnode.eth|${WIFI_VERSION}|\n|https.dnp.dappnode.eth|${HTTPS_VERSION}|\n|wireguard.dnp.dappnode.eth|${WIREGUARD_VERSION}|\n# Changes\nChanges implemented in release ${CORE_VERSION}\n# Attended version\nInstall and customize DAppNode using the attended ISO: **DAppNode-${CORE_VERSION}-debian-bookworm-amd64.iso**\n\n## ISO SHA-256 Checksum\n\`\`\`\nshasum -a 256 DAppNode-${CORE_VERSION}-debian-bookworm-amd64.iso\n${SHASUM_ATTENDED}\n\`\`\`\n# Unattended version\nInstall DAppNode easily using the unattended ISO: **DAppNode-${CORE_VERSION}-debian-bookworm-amd64-unattended.iso**\nDo a reboot right after the installation\n:warning: **Warning**: This ISO will install Dappnode automatically, deleting all existing partitions on the disk\n\ndefault login data:\n - **__user__**: dappnode\n - **__password__**: dappnode.s0\n## ISO SHA-256 Checksum\n\`\`\`\nshasum -a 256 DAppNode-${CORE_VERSION}-debian-bookworm-amd64-unattended.iso\n${SHASUM_UNATTENDED}\n\`\`\`\n# DAppNode for Raspberry Pi 4 64bit\n[Instructions](https://github.com/dappnode/DAppNode/wiki/DAppNodeARM-Installation-Guide)\n\ndefault login data:\n - **__user__**: dappnode\n - **__password__**: dappnodepi" > CHANGELOG.md
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I mistakenly removed this

run: |
cp ./images/DAppNode-debian-bookworm-amd64.iso DAppNode-${CORE_VERSION}-debian-bookworm-amd64.iso
file=$(ls images/Dappnode-debian-*.iso)
attended_filename="${file/images\/Dappnode-/Dappnode-${CORE_VERSION}-}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

- name: Set Ubuntu Dappnode unattended ISO name
run: |
cp ./images/DAppNode-debian-bookworm-amd64.iso DAppNode-${CORE_VERSION}-debian-bookworm-amd64-unattended.iso
file=$(ls images/Dappnode-ubuntu-*.iso)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

samer, why this change?

core_filename="${file/images\/Dappnode-/Dappnode-${CORE_VERSION}-}"
unattended_filename="${core_filename/%.iso/-unattended.iso}"
mv "$file" "$unattended_filename"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

# Ubuntu ISO UNATTENDED
- name: Build Ubuntu unattended
run: |
sed -i -e "/BASE_OS/s/ubuntu/debian/" docker-compose.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be done in a different PR, looks weird to edit compose env instead of running something like docker compose run --env see https://docs.docker.com/compose/environment-variables/set-environment-variables/#set-environment-variables-with-docker-compose-run---env

sed -i -e "/UNATTENDED/s/true/false/" docker-compose.yml
docker-compose build
docker-compose up
docker-compose up --build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should consider using new docker compose instead of legacy docker-compose

touch /usr/src/app/dappnode/iso_install.log

/usr/src/app/iso/scripts/generate_dappnode_iso_debian.sh
if [ "$BASE_OS" = "ubuntu" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say its cleaner to do something like

/usr/src/app/iso/scripts/${BASE_OS}.sh


# The main user needs to be added to the docker group to be able to run docker commands without sudo
# Explained in: https://docs.docker.com/engine/install/linux-postinstall/
addUserToDockerGroup() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be done in the installer or pre-requisites script and why?

}

# The main user needs to be added to the docker group to be able to run docker commands without sudo
# Explained in: https://docs.docker.com/engine/install/linux-postinstall/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should stop relying on upstream documentation that may change at any time and start using something dynamic like https://github.com/docker/docker-install/tree/master

}


add_docker_repo() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, we should be using something like https://github.com/docker/docker-install/tree/master

@stale
Copy link

stale bot commented Jan 31, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

@stale stale bot added the bot:stale label Jan 31, 2025
@stale
Copy link

stale bot commented Apr 25, 2025

This issue or pull request has been automatically been closed due to inactivity.

@stale stale bot closed this Apr 25, 2025
@stale stale bot removed the bot:stale label May 20, 2025
@pablomendezroyo pablomendezroyo merged commit 1b2dfa3 into master Jul 2, 2025
8 checks passed
@pablomendezroyo pablomendezroyo deleted the feature/add-ubuntu-iso-support branch July 2, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants