Docker installation in sles SP2

Please refer to official site for installation  details :  https://docs.docker.com/install/linux/docker-ee/suse/

Example installation for SUSE Linux SP2 12.2 + Docker  17.06.2

1. Prerequisites 

1.1. Get Docker EE URL by Registration , go to:

 https://store.docker.com/                          sunnydockerid/Netxxxxx1   nbtoronto/[email protected]#

1.2. OS requirements

    1. Linux version should be or higher than 12.x:

 # cat /etc/*release    

b. Firewall Configuration Check :

# systemctl list-unit-files | grep firewall 

Firewall Disabled: Docker creates a DOCKER iptables chain when it starts.

Firewall Enabled: adjust the start-up script order so that the firewall is   started before Docker, and Docker stops before the  firewall stops.

1.3. Uninstall old version: Older versions of Docker were called docker or docker-engine. If you use OS images from a cloud provider, you may need to remove the runc package, which conflicts with Docker EE

$ sudo zypper rm docker docker-ee runc 

$ sudo rpm -e docker-ee 

1.4. Check Filesystem

# cat /proc/filesystems | grep btrfs

btrfs should be listed.

1.5. Configure the Btrfs filesystem

1.5.1. Check file system:

df -T / /var /var/lib /var/lib/docker  

Note: duplicated result if you do not have separate mount point)

#mkdir /var/lib/docker  

Note: The only supported storage driver for Docker EE on SLES is Btrfs,

If the filesystem that hosts /var/lib/docker/ is not a BTRFS filesystem, you must configure a BTRFS filesystem and mount it on /var/lib/docker/.

1.5.2.   Format your dedicated block device or devices as a Btrfs filesystem.

# df –h   

# mkfs.btrfs -f  /dev/sda2  

1.5.3.  Mount the new Btrfs file system on the /var/lib/docker

 #mount -t btrfs /dev/sda2  /var/lib/docker  

 2. Install Docker EE

2.1 Using the repository 

STEP 1:    SET UP THE REPOSITORY

2.1.1.1:  Add a $DOCKER_EE_URL variable into your environment

DOCKER_EE_URL="<DOCKER-EE-URL>/sles/12.3/x86_64/stable-17.06" 

2.1.1.2. set up the stable repository

sudo zypper addrepo $DOCKER_EE_URL docker-ee-stable 

2.1.1.3. Import the GPG key from the repository

sudo rpm --import "<DOCKER-EE-URL>/sles/gpg"

Notes:  please be aware of the value is DOCKER-EE-URL, NOT DOCKER_EE_URL.

STEP 2: INSTALL DOCKER EE

2.1.2.1. Update the zypper package index

sudo zypper refresh  

2.1.2.2. Install the latest version of docker-ee

sudo zypper install docker-ee   

$ sudo docker info 

 

2.1.2.2. install a specific version: List binary packages and is truncated:

$ zypper search -s --match-exact -t package docker-ee

Note:omit the -t package flag from the command to also list source packages

$sudo zypper install docker-ee-<VERSION_STRING>

2.1.2.3.Configure Docker EE to use the Btrfs filesystem.

This is only required if the / filesystem is not using BTRFS.

# /etc/docker/daemon.json (create it if it does not exist) and add the following contents:

{  "storage-driver": "btrfs"}

2.1.3. Start Docker:

$ sudo service docker start 

$ sudo docker info 

 

 

2.1.4. Verify that Docker EE

$ sudo docker run hello-world 

This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.

systemctl status docker.service

NOW YOU HAVE YOUR DOCKER INSTALLED SUCCESSFULLY !!

2.2. From a Package 

2.2.1. Download the .rpm file and install it manually

<url>/sles/12.3/

2.2.2.Import Docker’s official GPG key:

$ sudo rpm --import <DOCKER-EE-URL>/sles/gpg

2.2.3.Install Docker EE

$ sudo zypper install /path/to/package.rpm

Docker EE is installed but not started. The docker group is created, but no users are added to the group.

2.2.4. Edit the file /etc/docker/daemon.json (create it if it does not exist)

{ "storage-driver": "btrfs" }

2.2.5.Start Docker:

$ sudo service docker start

2.2.6.Verify that Docker EE

$ sudo docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.

3. Post-installation steps for Linux 

3.1.  Configure Docker to start on boot

$ sudo systemctl enable docker (or upstart)

"Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service."

3.2.  Add user to docker group

$sudo usermod –a -G docker username

4. Uninstall Docker EE 

4.1 Uninstall the Docker EE package

$ sudo zypper rm docker-ee

Delete all images, containers, and volumes on your host:

$ sudo rm –rf /var/lib/docker/*

4.2 Unmount and format the Btrfs filesystem

If you used a separate BTRFS filesystem to host the contents of /var/lib/docker/, you can unmount and format the Btrfs filesystem.

$ sudo unmount /dev/sda2/  /var/lib/docker

4.3 Manually  delete any edited configuration files

e.g  /etc/docker/daemon.json

 

5. Reference

  • Docker overview:

https://docs.docker.com/engine/docker-overview/

  • About Docker CE

https://docs.docker.com/install/#supported-platforms

  • About Docker EE

https://docs.docker.com/ee/supported-platforms/

  • Docker EE for Red Hat Enterprise Linux 7.4

https://docs.docker.com/install/linux/docker-ee/rhel/#upgrade-with-a-package

  • Docker Installation in SLES SP2

https://docs.docker.com/install/linux/docker-ee/suse/

  • Post-installation steps for Linux

https://docs.docker.com/install/linux/linux-postinstall/

Notes:

For ,

"2.2.2.2 Install the latest version of docker-ee

sudo zypper install docker-ee   "

You may encounter below issues:

  • A:

" Failed to mount cd:///?devices=/dev/disk/by-id/ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001 on /var/adm/mount/AP_0xxXbHZP: Mounting media failed (mount: no medium found on /dev/sr0)

"

Solution1:

Step 1:  Right click on your vm at home page,  make sure the  two highlighted check boxes and file path is right, then click OK

Step 2: run the command again:

# zypper install docker-ee

Solution 2:

if you are not able to access to  host home page , in the  terminal, run command below :

$ sudo zypper lr –d

$sudo  zypper mr -d -R -p 101 1

Then reinstall docker-ee again:

$sudo zypper install docker-ee

  • :  
    If you encounter below error, please check you networking setting:

Solution: In Modify DNS Configuration, select the way the DNS configuration (name servers, search list, the content of the/etc/resolv.conf file) is modified.

Adding the following lines at the end of the file:

search suse

nameserver 192.168.28.212 (modify accord to your host machine)

nameserver 8.8.8.8

原文地址:https://www.cnblogs.com/ngtest/p/9369157.html

时间: 2024-11-05 15:54:00

Docker installation in sles SP2的相关文章

docker installation and usage

From 一.环境配置的难题 软件开发最大的麻烦事之一,就是环境配置.用户计算机的环境都不相同,你怎么知道自家的软件,能在那些机器跑起来? 用户必须保证两件事:操作系统的设置,各种库和组件的安装.只有它们都正确,软件才能运行.举例来说,安装一个 Python 应用,计算机必须有 Python 引擎,还必须有各种依赖,可能还要配置环境变量. 如果某些老旧的模块与当前环境不兼容,那就麻烦了.开发者常常会说:"它在我的机器可以跑了"(It works on my machine),言下之意就

CentOS 7 Docker Installation Guide

Install 1. 查看系统版本 & 升级yum源 [[email protected] ~]# cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) [[email protected] ~]# yum update 2. 安装docker [[email protected] ~]# yum install docker 3.启动docker deamon并将其设置成开机自启动[[email protected] ~]# 

Learn Docker

Learn Docker A Container is to VM today, what VM was to Physical Servers a while ago. The workload seems to shifting towards containers, and fast! In case you haven’t started ramping on it yet, you may find it a bit overwhelming to begin with. I thou

Install Docker on Mac OS X(转)

Install Docker on Mac OS X You can install Docker using Boot2Docker to run docker commands at your command-line. Choose this installation if you are familiar with the command-line or plan to contribute to the Docker project on GitHub. Alternatively,

Docker实用指南:将Python Web应用容器化

Docker实用指南:将Python Web应用容器化 提供 Zstack社区 前言 Web应用随时可能被攻击者利用来夺取整个主机的权限,这是很常见也是很恐怖的一件事.为了更高的安全性,就需要将不同应用之间进行隔离(尤其是在这些应用属于不同的用户的情况下),然而这种隔离的实现一直是个挑战.到目前为止,隔离性的实现方法已经有了很多,然而它们要么太过昂贵(时间的层面以及资源的层面),要么太过复杂(无论对开发者还是对管理员). 本文将讨论如何让"容器化"的Python Web应用跑在安全的沙

深入Docker

深入Docker 作者:ramanallamilli 随着持续交付等新型开发方法的兴起,工程师再也不会凡事靠运气,希望提交代码上去后,它能在未知环境正常运行.我们可以看到业界这样的转变——开发,质量保证和运维之间的传统壁垒在慢慢被打破.这些角色正在融合,产生一种新型工程师.开发运维(DevOps)这个新词儿在业界十分抢眼,随之我们看到工程开发团队更加敏捷,更加有效,可以更快地拥抱变化.这个转变也催生了一系列新的工具和框架,它们帮助我们自动化部署.自动化测试和标准化基础设施. 最前沿的工具之一就是

centos7 安装 卸载docker

Install with yum sudo tee /etc/yum.repos.d/docker.repo <<-'EOF' [dockerrepo] name=Docker Repository baseurl=https://yum.dockerproject.org/repo/main/centos/7/ enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg EOF Install the Docker packag

Docker Architecture Learning

目录 1. Docker简介 2. Docker的使用案例 3. Docker架构 4. 如何安装.部署Docker 1. Docker简介 Docker基于Go语言开发,代码托管在 Github上,并遵循Apache 2.0开源协议 Build, Ship and Run Any App, Anywhere Docker - An open platform for distributed applications for developers and sysadmins. 0x1: Dock

【翻译】docker install

---恢复内容开始--- [官方文档] Install Docker Estimated reading time: 8 minutes Docker is available in two editions: Community Edition (CE) and Enterprise Edition (EE). Docker Community Edition (CE) is ideal for developers and small teams looking to get started