redhat:docker-redhat:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
redhat:docker-redhat:start [2017/09/26 21:03] michaelredhat:docker-redhat:start [2019/12/23 21:52] (current) – [Installation von Docker und Docker-Compose] michael
Line 1: Line 1:
-====== Docker auf RHEL / CentOS 7 ======+====== Docker auf RHEL / CentOS 7/8 ======
 **In this 3-article series, we will discuss about Docker**, is an ''open-source lightweight virtualization tool'' which runs at top of Operating System level, allowing users to create, run and deploy applications, encapsulated into small containers. **In this 3-article series, we will discuss about Docker**, is an ''open-source lightweight virtualization tool'' which runs at top of Operating System level, allowing users to create, run and deploy applications, encapsulated into small containers.
  
  
 {{:redhat:docker-redhat:docker-generic-banner.jpg?nolink&500|}} {{:redhat:docker-redhat:docker-generic-banner.jpg?nolink&500|}}
 +
 +
 +===== Installation von Docker und Docker-Compose =====
 +
 +<WRAP center box 100%>
 +''**Step 1** - Install deps, add docker Repo and setup Docker:''<code>
 +# yum install -y yum-utils device-mapper-persistent-data lvm2
 +# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
 +# yum update
 +
 +# yum install docker-ce docker-ce-cli --nobest -y
 +
 +# systemctl enable docker --now
 +</code>
 +
 +''**Step 2** - Install docker-compose binary:'' <code># newest_version="$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep -Po '"tag_name": "\K.*?(?=")')"
 +
 +# curl -L "https://github.com/docker/compose/releases/download/${newest_version}/docker-compose-$(uname -s)-$(uname -m)" -o /bin/docker-compose
 +# chmod +x /bin/docker-compose
 +
 +# curl -L https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
 +
 +# docker-compose version
 +</code>
 +</WRAP>
 +
 +----
 +
 +===== Installation Docker Environment =====
 +
 +<WRAP center box 100%>
 +''**Step 1** - Create Project Folder:''<code>
 +# mkdir /opt/docker-PROJECT
 +</code>
 +
 +''**Step 2** - Create Project Docker Compose-File:''<code>
 +# vim /opt/docker-PROJECT/docker_compose.yml
 +</code>
 +
 +<wrap em>DEMO - Docker Compose File:</wrap>
 +<sxh yaml>
 +version: "3.2"
 +
 +services:
 +  # ----------------------------------------------------------------------------
 +  pihole:
 +    image: IMAGE/IMAGE:latest
 +    container_name: "PROJECT-main"
 +    volumes:
 +      - /opt/docker-PROJECT/DOCKERHOST/:/etc/CONTAINER/
 +      - /etc/localtime:/etc/localtime:ro
 +    environment:
 +      - VARIABLE1=value_xy
 +      - VARIABLE2=value_xy
 +    #ports:
 +    #  - 53:53/tcp
 +    #  - 53:53/udp
 +    #  - 67:67/udp
 +    #  - 81:80
 +    #networks:
 +    #  - local
 +    
 +    restart: always
 +    network_mode: "host"
 +
 +# ------------------------------------------------------------------------------
 +#networks:
 +#  local:
 +#    driver: bridge
 +</sxh>
 +
 +''**Step 3** - Start / Stop Docker Compose Projects:''<code>
 +# docker-compose -f /opt/docker-PROJECT/docker_compose.yml up -d
 +# docker-compose -f /opt/docker-PROJECT/docker_compose.yml down
 +</code>
 +
 +</WRAP>
 +
 +
 +<WRAP center round important 100%>
 +''**Enabling access to files protected by SELinux**''
 +In order to give a container access to files protected by SELinux, you need to use one of the following volume options: z or Z.
 +
 +  * ''**z(lower)**: relabels the content you’re mounting into the container, and makes it shareable between containers.''
 +
 +  * ''**Z(upper)**: relabels the content you’re mounting into the container, and makes it private. So, mounting this file in another container won’t work.''
 +</WRAP>
 +
 +[[http://jaormx.github.io/2018/selinux-and-docker-notes/]]
 +
 +----
 +
 +
 +
 +FIXME
  
 <WRAP center round box 100%> <WRAP center round box 100%>
Line 15: Line 110:
  
  
-  * ''**[[redhat:docker-redhat:docker-compose-redhat|Part 4: Use Docker in Production, with docker-compose like the Swiss-PostCentOS/RHEL 7/6]]**''+  * ''**[[redhat:docker-redhat:docker-compose-redhat|Part 4: Use Docker in Production, with docker-compose like the Swiss-Post does on CentOS/RHEL 7]]**''
  
 https://www.linuxtechi.com/install-use-docker-compose-to-deploy-containers-in-centos7/ https://www.linuxtechi.com/install-use-docker-compose-to-deploy-containers-in-centos7/
Line 26: Line 121:
  
 https://www.tecmint.com/install-docker-and-learn-containers-in-centos-rhel-7-6/ https://www.tecmint.com/install-docker-and-learn-containers-in-centos-rhel-7-6/
 +
 +
  • redhat/docker-redhat/start.1506452637.txt.gz
  • Last modified: 2017/09/26 21:03
  • by michael