Is it possible to install only the docker cli and

2020-02-17 08:42发布

I want to have docker CLI to connect to remote daemon but do I need to install the whole engine including daemon on the local machine?

标签: docker
4条回答
劫难
2楼-- · 2020-02-17 08:58

If you want to install Docker in Linux, then in the newest 1.12.0 release, Docker daemon and Docker client are in separate binary files.

This has been mentioned in release log:

Split the binary into two: docker (client) and dockerd (daemon) #20639

If you are installing Docker in Mac, then Mac OS binary is client-only: resource

查看更多
爷的心禁止访问
3楼-- · 2020-02-17 09:02

You can (like the other answer suggests) download it direct from Docker:

docker_url=https://download.docker.com/linux/static/stable/x86_64
docker_version=18.03.1-ce
curl -fsSL $docker_url/docker-$docker_version.tgz | \
tar zxvf - --strip 1 -C /usr/bin docker/docker

The difference from the other answer is that there is no intermediate tar file. I use this in a Dockerfile RUN layer.

查看更多
倾城 Initia
4楼-- · 2020-02-17 09:09

First, download and unzip/untar the release for your system. Here are x86_64 binaries for mac, linux, windows.

After expanding the archive, you can find the docker CLI executable at ./docker/docker - move that file into your path, and you're done.

If you're specifically looking to install the docker CLI into a docker image, here's my Dockerfile command to do so:

ENV DOCKERVERSION=18.03.1-ce
RUN curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \
  && tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 \
                 -C /usr/local/bin docker/docker \
  && rm docker-${DOCKERVERSION}.tgz

h/t to this comment

查看更多
放我归山
5楼-- · 2020-02-17 09:11

On Windows, you can install the CLI by itself using chocolatey package manager.

Once you have chocolatey loaded you can run this from an admin command prompt:

choco install /y docker-cli

This seems to be much more up-to-date than the Windows link provided by Aaron, for some reason. (v19 instead of v17, as of Jan 2020)

查看更多
登录 后发表回答