Docker Install on Linux 6.x

This article gives a step-by-step guide to install docker on Linux 6.x.

Prerequisites

Linux machine or VM should have Oracle Linux 6

check your system Expand source

Run as root user:

/usr/local/packages/aime/emdw/run_as_root su

Change /etc/yum.conf by adding :

proxy=http://www-proxy.us.oracle.com:80

Set the following proxy variables:

export http_proxy=http://www-proxy.us.oracle.com:80
export https_proxy=http://www-proxy.us.oracle.com:80
export HTTP_PROXY=http://www-proxy.us.oracle.com:80
export HTTPS_PROXY=http://www-proxy.us.oracle.com:80
export no_proxy=localhost,127.0.0.1,*.oracle.com,*.oraclecorp.com

Check if /etc/yum.repos.d/public-yum-ol6.repo exists:

  • If Yes
    • vi public-yum-ol6.repo

    • Enable ol6_UEKR4 (enable=1)
    • Disable anything else (enable=0)
  • If No

Upgrade kernel

Since docker requireskenerl4.x and now our image is on 3.8.x, we need to update kernal by running:

yum -y upgrade kernal*

update Kernal Expand source

In my case, when I run yum -y upgrade kernal*, it gives the following error message:

update error message Expand source

Thus I use  yum -y upgrade kernal* --skip-broken instead, and the issue is gone.

Reboot your machine to take the upgrade into effect:

/sbin/shutdown -r now

This process will probably take more than 4 hrs. Just wait the machine come back.

You can check kernal by running uname -a, and you will find kernal has been upgrated to 4.x.

In my case, it fails to upgrade kernal firstly due to unknown reason although the log indicates upgrate is complete.

I just re-run yum -y upgrade kernal* --skip-broken and reboot again. It works then.

change public-yum-ol6.repo:

 

vi /etc/yum.repos.d/public-yum-ol6.repo

  • enable ol6_addons

  • enable ol6_latest

  • disable anything else

Install Docker Engine

yum install -y docker-engine 

 

 

Configure Docker

Step 1:

  • vi /etc/sysconfig/docker
  • replace other_args=''  with the following content:

    other_args='-b=oradocker0 -g /scratch/docker --group=docker --storage-driver=overlay --storage-opt dm.basesize=60g --insecure-registry ossa.docker.oraclecorp.com --insecure-registry oscf.docker.oraclecorp.com --insecure-registry faxarch.docker.oraclecorp.com'

     

    DOCKER_CERT_PATH=/etc/docker

     

    export HTTP_PROXY="http://www-proxy.us.oracle.com:80"

    export HTTPS_PROXY="http://www-proxy.us.oracle.com:80"

    export NO_PROXY="localhost,127.0.0.1,.us.oracle.com,.oraclecorp.com"

     

    umask 022

    • Docker images will be located at /scratch/docker   (-g option)

    • Maximum image size up from 10Gb to 60 GB  (--storage-opt dm.basesize=60g, I still set it as 10g)
    • Images can be pulled from Artifactory faxarch:  --insecure-registry faxarch.docker.oraclecorp.com

Step 2:

  • vi /etc/init.d/docker # autofs bug
  • change the line

    "$unshare" -m -- $exec $other_args >> $logfile 2>&1 &

  • to

    $exec $other_args >> $logfile 2>&1 &

Step 3:

  • Configure Network: (due to SLC OpenStack images, do this on all to keep consistent)
  • run the following command to create a new file:

    vi /etc/sysconfig/network-scripts/ifcfg-oradocker0

  • add the following lines to the above file:

    DEVICE=oradocker0

    BOOTPROTO=none

    IPADDR=172.18.0.1

    NETMASK=255.255.0.0

    ONBOOT=yes

    TYPE=Bridge

    NM_CONTROLLED=no

    DELAY=0

Step 4: start docker

  • /sbin/chkconfig docker on
  • sudo /sbin/ifconfig docker0 down  (may say it does not exist, so ignore)
  • sudo /sbin/service network restart

    [root@slc05ibr 1.0]# sudo /sbin/service network restart

    Shutting down interface eth0:                              [  OK  ]

    Shutting down loopback interface:                          [  OK  ]

    Bringing up loopback interface:                            [  OK  ]

    Bringing up interface eth0:  Determining if ip address 10.245.225.119 is already in use for device eth0...

                                                               [  OK  ]

    Bringing up interface oradocker0:  Determining if ip address 172.18.0.1 is already in use for device oradocker0...

                                                               [  OK  ]

  • /sbin/service docker start

    [root@slc05ibr lib]# /sbin/service docker start

    Starting docker:    .                                  [  OK  ]

  • /usr/sbin/usermod -a -G docker <username_who_wants_to_run_docker_cmds>

    [root@slc05ibr imagedb]# /usr/sbin/usermod -a -G docker <name>

    usermod: group 'docker' does not exist

    [root@slc05ibr imagedb]# /usr/sbin/groupadd docker

    [root@slc05ibr imagedb]# /usr/sbin/usermod -a -G docker <name>

    [root@slc05ibr imagedb]#

  • /sbin/service docker status

    [root@slc05ibr 1.0]# /sbin/service docker status

    docker (pid  26523) is running...

 

Step 5: docker test

  • docker run hello-world

    [root@slc05ibr ~]# docker run hello-world

    Unable to find image 'hello-world:latest' locally

    latest: Pulling from library/hello-world

    ca4f61b1923c: Pull complete

    Digest: sha256:97ce6fa4b6cdc0790cda65fe7290b74cfebd9fa0c9b8c38e979330d547d22ce1

    Status: Downloaded newer image for hello-world:latest

    Hello from Docker!

    This message shows that your installation appears to be working correctly.

    To generate this message, Docker took the following steps:

    1. The Docker client contacted the Docker daemon.

    2. The Docker daemon pulled the "hello-world" image from the Docker Hub.

        (amd64)

    3. The Docker daemon created a new container from that image which runs the

        executable that produces the output you are currently reading.

    4. The Docker daemon streamed that output to the Docker client, which sent it

        to your terminal.

    To try something more ambitious, you can run an Ubuntu container with:

    $ docker run -it ubuntu bash

    Share images, automate workflows, and more with a free Docker ID:

    https://cloud.docker.com/

    For more examples and ideas, visit:

    https://docs.docker.com/engine/userguide/

Issues & Solutions

#

Issue

Solutions

#

Issue

Solutions

1Cannot connect to the Docker daemon. Is 'docker -d' running on this host?

Run:

docker version

If there is the same problem:

Just reboot VM.

 

check if docker is running, if not start docker.

If yes, try as ROOT user.

2

You do not have enough privileges to perform this operation.

Run as root user:

/usr/local/packages/aime/emdw/run_as_root su
3

Docker status:

docker dead but subsys locked

 
4  
5  

 

REF

Install and Configure Docker on Oracle Linux 6 System

Installing Docker on OracleLinux 6

<think>嗯,用户遇到了Docker Desktop启动的问题,需要帮助解决。首先,我得回忆一下常见的Docker启动问题可能有哪些。根据之前的引用内容,比如引用[1]提到重启Docker守护进程,这可能是一个常见的解决方法。另外,引用[3]中的Connection reset by peer错误可能和服务器连接数有关,但这里用户的问题更偏向于Docker本身无法启动,所以可能需要检查系统服务、配置或者日志。 首先,应该建议用户检查系统服务,确保Docker相关的服务都在运行。比如在Linux上,使用systemctl或者service命令来重启Docker。然后,用户可能需要查看日志,用docker info或者journalctl来获取详细信息,这有助于定位问题。比如,如果日志显示端口冲突,就需要关闭占用端口的进程。 另外,用户可能没有足够的权限,尤其是在Linux系统中,需要将用户加入docker组。还有可能是防火墙或安全软件阻止了Docker运行,需要检查这些设置。如果问题依然存在,重置Docker到出厂设置或者重新安装也是可行的步骤。另外,Hyper-V或WSL2在Windows上的配置是否正确也可能影响Docker的启动,需要确保这些功能已启用。 可能还需要考虑系统资源是否足够,比如内存不足时Docker可能无法启动。最后,查看官方文档和社区讨论,看看是否有已知的解决方案。比如引用[2]提到Docker EE和CE的区别,确保用户安装的是正确的版本。综合这些步骤,应该能覆盖大部分Docker Desktop启动的问题。</think>### Docker Desktop启动问题解决方案 #### 1. 检查系统服务状态 - **Windows系统**:确保`Hyper-V`和`Windows Subsystem for Linux (WSL2)`已启用。可通过PowerShell运行: ```powershell Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All wsl --install ``` - **Linux系统**:重启Docker守护进程: ```bash $ sudo service docker restart [^1] ``` #### 2. 查看日志定位问题 - 通过命令行查看Docker日志: ```bash $ docker info $ journalctl -u docker.service # Linux系统专用 ``` 若日志显示端口冲突(如`Connection reset by peer`[^3]),关闭占用端口的进程。 #### 3. 权限与配置修复 - **用户组权限**(Linux): ```bash $ sudo usermod -aG docker $USER ``` - **重置Docker配置**:在Docker Desktop设置中选择**Reset to factory defaults**,清除缓存和配置文件。 #### 4. 防火墙与安全软件 - 暂时关闭防火墙或杀毒软件,检查是否因安全策略拦截Docker进程。例如,某些规则可能阻止Docker虚拟网络初始化。 #### 5. 重装Docker Desktop - 卸载后删除残留文件(Windows需清理`C:\Program Files\Docker`和`%APPDATA%\Docker`),重新安装最新版本。注意选择与系统匹配的版本(Docker CE/EE差异[^2])。 #### 6. 检查系统资源 - 若虚拟机资源不足,调整Docker Desktop内存分配(设置 → Resources → Advanced)。例如,将内存从2GB提升至4GB。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值