Can't run Curl command inside my Docker Container

后端 未结 6 1311
谎友^
谎友^ 2020-12-13 08:01

I created a docker container from my OS X VM Docker host. I created it using the run command and created the container based off the ubuntu:xenial image off do

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 08:45

    This is happening because there is no package cache in the image, you need to run:

    apt-get -qq update
    

    before installing packages, and if your command is in a Dockerfile, you'll then need:

    apt-get -qq -y install curl
    

    After that install ZSH and GIT Core:

    apt-get install zsh
    apt-get install git-core
    

    Getting zsh to work in ubuntu is weird since sh does not understand the source command. So, you do this to install zsh:

    wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
    

    and then you change your shell to zsh:

    chsh -s `which zsh`
    

    and then restart:

    sudo shutdown -r 0
    

    This problem is explained in depth in this issue.

提交回复
热议问题