Showing posts with label docker. Show all posts
Showing posts with label docker. Show all posts

Saturday, October 19, 2019

ocp 3.9 origin installation on centos 7

1) install required packages 

yum install -y wget git  nano net-tools docker-1.13.1 bind-utils iptables-services bridge-utils bash-completion kexec-tools sos psacct openssl-devel httpd-tools NetworkManager python-cryptography python-devel python-passlib java-1.8.0-openjdk-headless "@Development Tools";

2) Add ansible repo for 2.6 version 

[ansible]
name = Ansible Repo
baseurl = https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/
enabled = 1
gpgcheck =  0

3) update centos 7

yum update -y

4) start and enable docker 

systemctl start docker && systemctl enable docker && systemctl status docker

5) install ansible 2.6 required for ocp 3.9 ansible playbook 

yum -y install ansible-2.6* pyOpenSSL

6) clone ansible repository 

git clone https://github.com/openshift/openshift-ansible.git -b release-3.9

7) create ssh key and copy to target system 

ssh-keygen
ssh-copy-id   master infra worker

7) edit inventory ini for 1 master 1 worker and 1 infra node without LB


8) Run playbooks

ansible-playbook -i inv.ini playbooks/prepare.yml
ansible-playbook -i inv.ini playbooks/deploy_cluster.yml

Wednesday, February 14, 2018

Linux command line proxy / docker proxy configuraiton

Linux command line proxy configuration 

 If your system  placed in the restricted network and it  require to connect Internet through proxy server then you need to setup proxy server configuration by exporting http_proxy  or https_proxy linux environment value.

syntax :

export http_proxy=http://username:password@proxyserver:proxyport

export https_proxy=https://username:password@proxyserver:proxyport

example:

export http_proxy=http://kamal:kamal@myproxy.mynetwork.com:8080

export https_proxy=http://kamal:kamal@myproxy.mynetwork.com:8443

if you want to revert http_proxy config then simply type  $unset http_proxy from linux command prompt .

Docker proxy configuration

Same way you need to setup proxy configuration for docker too so that you can download / search / push / pull docker images from public docker registry.

by default docker wont take proxy config from environment variable you need to config by creating http-proxy.config file in the docker service directory.

1) Create a directory path and config file as a root user ( remember your user need to be a member of docker group or you must be a root user to perform this docker config by default directory and configuration file doesn't exist  )

# mkdir -p /etc/systemd/system/docker.service.d

vi /etc/systemd/system/docker.service.d/http-proxy.conf    or      #vi /etc/systemd/system/docker.service.d/https-proxy.conf

2) Edit docker proxy  config file
  
#vi /etc/systemd/system/docker.service.d/https-proxy.conf
[Service]
Environment="HTTP_PROXY=http://kamal:durai@proxy.myserver.com:8080"

3)Reload systems daemon configurations

 #systemctl daemon-reload

4) Restart docker service
  #systemctl restart docker
  
5) Verify docker proxy config
  #systemctl show --property=Environment docker    

6) Search docker images from docker registry 

#docker search nginx 

now you can see number of  nginx docker iamges from varies registry   

Tuesday, December 8, 2015

Docker installation and proxy settings from docker site (Cent OS)

I - Installation :-

1)Adding docker yum repository to your local machine.

#vi  /etc/yum.repos.d/docker.repo

[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
#Proxy config -- optional
#proxy=http://192.168.1.1:80
#proxy_username=domainname\username
#proxy_password=password

2)Install docker throught yum

#yum install docker-engine

3)start & check status of docker service using systemctl

#systemctl start docker.service
#systemctl status  docker.service

II - Docker Proxy configuration for  docker image :- 

1)create a directory for docker service

#mkdir /etc/systemd/system/docker.service.d

2)Add proxy settings in config file

#vi /etc/systemd/system/docker.service.d/http-proxy.conf

[Service]
Environment="http_proxy=http://domainname\username:password@192.168.1.1:80"

3)Reload docker config and restart docker service

  # systemctl daemon-reload
  # systemctl show docker --property Environment
  # systemctl restart docker

4)Check docker service and pull ubuntu image

  #docker run hello-world
  #docker run -it ubuntu bash

5)check docker version
 
  #docker info

Monday, April 6, 2015

Yum based Docker installation (Redhat EL 6.6 )

Yum based Docker installation :-

Requirements :

1)Redhat linux 6.5 or above
2) EPEL Repository

Procedure :-

1) Download EPEL 6 - 64 bit repository 

#rpm -ivh  http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
#yum update
#yum repolist

2) Install docker-io through yum 

#yum -y install docker-io

3) Disable selinux 

#SELINUX=disabled in  /etc/selinux/config file and reboot system

4) Start and enable docker daemon 

#service docker start
#chkconfig docker on
#service docker status

6) Check docker installation - 250 MB download from internet depends on your download speed

# docker run -i -t fedora /bin/bash

Unable to find image 'fedora:latest' locally
fedora:latest: The image you are pulling has been verified

511136ea3c5a: Pull complete
00a0c78eeb6d: Pull complete
834629358fe2: Pull complete
Status: Downloaded newer image for fedora:latest


Reference :-

1) http://docs.docker.com/installation/rhel/