How to install Apache in Linux container


[root@65d264fc1d7e /]# yum -y install httpd
Loaded plugins: fastestmirror, ovl
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.cisp.com
* extras: mirrors.mit.edu
* updates: mirror.trouble-free.net
Resolving Dependencies
–> Running transaction check
—> Package httpd.x86_64 0:2.2.15-69.el6.centos will be installed
–> Processing Dependency: httpd-tools = 2.2.15-69.el6.centos for package: httpd-2.2.15-69.el6.centos.x86_64
–> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-69.el6.centos.x86_64

docker pull


How to download docker images and access the images
In this case, I am pulling Centos6 Image from Docker and accessing it using docker run -it centos:6 /bin/bash and updating my image

[cloud_user@aryan1c ~]$ docker pull centos:6
Trying to pull repository docker.io/library/centos …
6: Pulling from docker.io/library/centos
ff50d722b382: Pull complete
Digest: sha256:dec8f471302de43f4cfcf82f56d99a5227b5ea1aa6d02fa56344986e1f4610e7
Status: Downloaded newer image for docker.io/centos:6
[cloud_user@aryan1c ~]$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/centos 6 d0957ffdf8a2 2 months ago 194 MB

[cloud_user@aryan1c ~]$ docker run -it centos:6 /bin/bash
[root@65d264fc1d7e /]# ls
bin dev etc home lib lib64 lost+found media mnt opt proc root run sbin selinux srv sys tmp usr var
[root@65d264fc1d7e /]# yum update

Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?


Try:

[cloud_user@aryan1c ~]$ sudo systemctl start docker
[cloud_user@aryan1c ~]$ sudo systemctl enable docker 

[cloud_user@aryan1c ~]$ sudo systemctl start docker
[cloud_user@aryan1c ~]$ sudo systemctl enable docker
[cloud_user@aryan1c ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[cloud_user@aryan1c ~]$

Install Docker from the Default CentOS 7 Repository


After logging into the server, install the latest version of Docker using yum.

$ sudo yum -y install docker

Once installation completes, enable & start the service using systemd.

Create a new group named docker, then add the cloud_user user to the group.

 

# groupadd docker
# usermod -aG docker cloud_user
# systemctl enable –now docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd
/system/docker.service.
[root@ip-10-0-1-121 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES

Logout from Root

ssh cloud_user@youripaddress
Enter the password

[cloud_user@ip-10-0-1-121 ~]$ ssh cloud_user@10.0.1.121
The authenticity of host ‘10.0.1.121 (10.0.1.121)’ can’t be established.
ECDSA key fingerprint is SHA256:URC6viTN+8b87rv0V7t9lsCDiq5fwAlguWIYtQSbfCI.
ECDSA key fingerprint is MD5:ac:49:84:5e:c2:53:c7:d1:a2:d8:70:80:61:31:df:60.
Are you sure you want to continue connecting (yes/no)? y
Please type ‘yes’ or ‘no’: yes
Warning: Permanently added ‘10.0.1.121’ (ECDSA) to the list of known hosts.
Password:
[cloud_user@ip-10-0-1-121 ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES

Docker is Installed and available to test

How To Install Git on Ubuntu 18.04


Step 1 — Update Default Packages

Logged into your Ubuntu 18.04 server as a sudo non-root user, first update your default packages.

  • sudo apt update

Step 2 — Install Git

  • sudo apt install git

Step 3 — Confirm Successful Installation

You can confirm that you have installed Git correctly by running this command and receiving output similar to the following:

  • git –version
Output
git version 2.17.1

%d bloggers like this: