Skip to content

Commit

Permalink
fix quoting
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo committed Jul 26, 2023
1 parent a8b9bb8 commit b51592d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/scripts/docker_migration_apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# Switch docker installtion method to use apt official repository
# OS supported: Ubuntu, Debian, Raspbian
# TODO: check if its needed to execute the script docker installed through pkg or apt
# TODO: rollback docker? /var/lib/docker
# TODO: research if previous removal is needed
# TODO: implement `systemctl restart docker` if docker was installed but not started
Expand All @@ -18,16 +19,13 @@ export DEBIAN_FRONTEND=noninteractive

log "Starting docker migration to apt repository"

# Check if docker is installed via package manager
# TODO: consider checking all the docker packages: docker.io docker-doc docker-compose podman-docker containerd runc
if dpkg -l | grep -i docker; then
log "Docker is installed via package manager, skipping upgrade"
exit 0
fi
# TODO: Check if docker is installed via package manager

# Get docker version
DOCKER_VERSION=$(docker version --format '{{.Server.Version}}')

# array of legacy docker versions installed in dappnode

# Check the OS
if [ -f /etc/os-release ]; then
source /etc/os-release
Expand Down Expand Up @@ -107,8 +105,8 @@ if [ $? -ne 0 ]; then
fi
# 3. Use the following command to set up the repository
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] "${DOWNLOAD_REPO_URL}" \
"$(source /etc/os-release && echo "$VERSION_CODENAME")" stable" |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] ${DOWNLOAD_REPO_URL} \
$(source /etc/os-release && echo "$VERSION_CODENAME") stable" |
tee /etc/apt/sources.list.d/docker.list >/dev/null
if [ $? -ne 0 ]; then
log "Failed to add docker repository."
Expand All @@ -124,7 +122,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
# 2. Install Docker Engine, containerd, and Docker Compose.
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | tee -a /usr/src/dappnode/logs/upgrade_013.log
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y | tee -a /usr/src/dappnode/logs/upgrade_013.log
if [ $? -ne 0 ]; then
log "Failed to install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin."
exit 1
Expand Down

0 comments on commit b51592d

Please sign in to comment.