Skip to content

Instantly share code, notes, and snippets.

@umardx
Last active December 6, 2025 11:54
Show Gist options
  • Select an option

  • Save umardx/f3a62fb6e449073aea03c35b5aaa33d2 to your computer and use it in GitHub Desktop.

Select an option

Save umardx/f3a62fb6e449073aea03c35b5aaa33d2 to your computer and use it in GitHub Desktop.

Install docker

curl -sL https://get.docker.com | sh

Change default docker directory

# Create the Docker configuration directory if it doesn't exist
sudo mkdir -p /etc/docker

# Create/overwrite the daemon.json to set the new data-root
sudo tee /etc/docker/daemon.json >/dev/null <<EOF
{
  "data-root": "/data/docker"
}
EOF

# Restart the Docker daemon to apply the changes
sudo systemctl restart docker

# (Optional) Verify the change
echo "Verifying Docker Root Directory..."
sudo docker info | grep "Docker Root Dir"

Install docker-compose

# get latest version tag
VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)

# Install docker-compose
curl -sL https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
curl -sL https://raw.githubusercontent.com/docker/compose/${VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose

# Validate version
docker-compose -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment