How to install docker specific version

后端 未结 8 1238
半阙折子戏
半阙折子戏 2021-01-30 17:34

How to install specific version of Docker(like 1.3.2)?

I am unable to find any documentation in docker official docs. Referring this link for Ubuntu.

<
相关标签:
8条回答
  • 2021-01-30 17:45

    Got the answer from this github issue comment.

    Summary of above commit:-

    echo deb http://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list
    
    apt-key adv --keyserver pgp.mit.edu --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
    
    apt-get update
    apt-get install -y lxc-docker-1.3.3
    

    If permission issue then use sudo as:

    echo deb http://get.docker.com/ubuntu docker main | sudo tee /etc/apt/sources.list.d/docker.list
    
    sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
    
    sudo apt-get update
    sudo apt-get install -y lxc-docker-1.3.3
    

    Bonus Tip:

    Don't know which version? Then hit Tab after lxc-docker- as:

    sudo apt-get install -y lxc-docker-<Hit Tab here>
    

    to see list of available docker versions.

    0 讨论(0)
  • 2021-01-30 17:56

    Another option is to replace install -y lxc-docker in the script with install -y lxc-docker-<version>.

    For example, this will install docker 1.6.2:

    RUN wget -qO- https://get.docker.com/ubuntu/ | sed -r 's/^apt-get install -y lxc-docker$/apt-get install -y lxc-docker-1.6.2/g' | sh
    
    0 讨论(0)
  • 2021-01-30 17:58

    I got version 1.6.2 years old from source on Ubuntu 16.04. This might not translate to other Docker versions:

    1. git clone https://github.com/moby/moby docker

    2. cd docker

    3. git tag -l -- find your tag of interest in this list (e.g. v1.6.2)

    4. git checkout <tag name>

    5. sudo make build

      Depending on how old your version is, you might see some errors in this step. If you see sample docker images failing to get pulled in, feel free to comment the associated lines out in the Dockerfile. You might see a lvm2 source related failure. Modify the non-existent link to the source specified here. Specifically, in my case, I had to change make Dockerfile refer to the lvm2 source code at git at git://sourceware.org/git/lvm2.git .

    6. sudo make binary

    0 讨论(0)
  • 2021-01-30 18:04

    I find easier to check available versions with

    sudo apt-cache policy docker-engine
    

    and then install the one you want:

    sudo  apt-get install docker-engine=1.7.1-0~trusty
    

    It consists on simply following the instructions from docker docs https://docs.docker.com/engine/installation/ubuntulinux/, but selecting a particular version

    0 讨论(0)
  • 2021-01-30 18:04

    Follow below step to install specific version of docker-ce and docker-ce-cli .

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    sudo apt-get update
    

    Find the specific version of docker-ec and docker-ce-cli . Her in this example i am looking for 19.03

    apt-cache policy docker-ce | grep 19
    apt-cache policy docker-ce-cli | grep 19
    

    From above command you will get list of docker version , copy respected version.

    apt-get install docker-ce=5:19.03.14~3-0~ubuntu-bionic docker-ce-cli=5:19.03.14~3-0~ubuntu-bionic 
    
    0 讨论(0)
  • 2021-01-30 18:07

    How I did it on my laptop (btw https://get.docker.com/ubuntu/ not available anymore):

    $ wget -qO- https://get.docker.com/ | sh      # install resources
    $ apt-cache showpkg docker-engine             # show version which are available
    $ apt-get install docker-engine=1.8.2-0~willy # install 1.8.2 version
    $ sudo apt-mark hold docker-engine            # prevent upgrade on sys upgrade
    $ docker version                              # check installed docker version
    
    0 讨论(0)
提交回复
热议问题