Install Docker, Compose and Buildx Manually

Category Docker

In this article, Install the docker binary manually. The setup compose and buildx. So that docker buildx or docker compose (There is a space after docker) command will work as like any other installation.

These can be used install docker with in docker.

Docker

DOCKER_VERSION=27.2.0
curl -SLO "https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz"
tar -xzvf "docker-${DOCKER_VERSION}.tgz" -C /tmp
cp /tmp/docker/docker /usr/local/bin/
rm -rf /tmp/docker
rm -rf "docker-${DOCKER_VERSION}.tgz"

The compose and buildx comes under the docker cli plugins.

Docker Buildx

DOCKER_BUILDX_VERSION=0.16.2
curl -SLO "https://github.com/docker/buildx/releases/download/v${DOCKER_BUILDX_VERSION}/buildx-v${DOCKER_BUILDX_VERSION}.linux-amd64"
mkdir -p ${HOME}/.docker/cli-plugins
cp "buildx-v${DOCKER_BUILDX_VERSION}.linux-amd64" ${HOME}/.docker/cli-plugins/docker-buildx
rm "buildx-v${DOCKER_BUILDX_VERSION}.linux-amd64"

Docker Compose

DOCKER_COMPOSE_VERSION=v2.29.2
curl -SLO "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64"
mkdir -p ${HOME}/.docker/cli-plugins
cp "docker-compose-linux-x86_64" ${HOME}/.docker/cli-plugins/
rm "docker-compose-linux-x86_64"

Read more here

Usual way of install Docker and Compose

Docker

curl -sSL https://get.docker.com/ | sh
sudo usermod -aG docker ${USER}

Docker compose

DOCKER_COMPOSE_VERSION=v2.29.2
sudo curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
cat << "EOF" >> ~/.bashrc
alias fig="docker-compose"
EOF

Why fig alias?

The docker-compose project was originally named fig as an open-source initiative. After Docker acquired it, the project was renamed to docker-compose.

Just a history.

Refer this commit

Show Comments
\