Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, April 27, 2020

How to Change the SHELL on Building the DOCKER Image

RUN echo I am using the default (/bin/sh)
RUN ["/bin/bash", "-c", "echo I am using bash"]
SHELL ["/bin/bash", "-c"]
RUN echo I am using bash, which is now the default
RUN ["/bin/sh", "-c", "echo I am using /bin/sh"]
RUN ["echo", "I don't use a shell at all"]

Sunday, April 26, 2020

Increase inotify file watch limits



inotify has three parameters, that can be set in /proc interfaces: `max_user_instances`, `max_user_watches` and `max_queued_events`.

max_user_watches
You can get the current “max_user_watches” value by executing the below command:
$ cat /proc/sys/fs/inotify/max_user_watches

You can set a new limit temporary with:
$ sudo sysctl fs.inotify.max_user_watches=524288
$ sudo sysctl -p

If you like to make your limit permanent, use:
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -p

max_queued_events
You can get the current “max_queued_events” value by executing the below command:
$ cat /proc/sys/fs/inotify/max_queued_eventss

You can set a new limit temporary with:
$ sudo sysctl fs.inotify.max_queued_events=524288
$ sudo sysctl -p

If you like to make your limit permanent, use:
$ echo fs.inotify.max_queued_events=524288 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -p

max_user_instances
You can get the current “max_user_instancesvalue by executing the below command:
$ cat /proc/sys/fs/inotify/max_user_instances

You can set a new limit temporary with:
$ sudo sysctl fs.inotify.max_user_instances s=524288
$ sudo sysctl -p

If you like to make your limit permanent, use:
$ echo fs.inotify.max_user_instances =524288 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -p

Saturday, April 25, 2020

autogen.sh execution failed

./autogen.sh: line 9: aclocal: command not found
./autogen.sh: line 10: autoheader: command not found
./autogen.sh: line 11: automake: command not found
./autogen.sh: line 12: autoconf: command not found


Solution:
yum install libtool gcc-c++ automake autoconf

pywatchman/bser.c:31:20: error: Python.h: No such file or directory

pywatchman/bser.c:31:20: error: Python.h: No such file or directory
pywatchman/bser.c:68: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
pywatchman/bser.c:73: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bserobj_tuple_length’
pywatchman/bser.c:79: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pywatchman/bser.c:85: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bserobj_sq’
pywatchman/bser.c:96: error: expected ‘)’ before ‘*’ token
pywatchman/bser.c:104: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pywatchman/bser.c:138: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bserobj_map’
pywatchman/bser.c:144: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bserObjectType’
pywatchman/bser.c:186: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pywatchman/bser.c:196: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘next_power_2’
pywatchman/bser.c:213: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
pywatchman/bser.c: In function ‘bser_append’:
pywatchman/bser.c:215: warning: implicit declaration of function ‘next_power_2’
pywatchman/bser.c:215: error: ‘len’ undeclared (first use in this function)
pywatchman/bser.c:215: error: (Each undeclared identifier is reported only once
pywatchman/bser.c:215: error: for each function it appears in.)
pywatchman/bser.c:217: warning: implicit declaration of function ‘realloc’
pywatchman/bser.c:217: warning: incompatible implicit declaration of built-in function ‘realloc’
pywatchman/bser.c:226: warning: implicit declaration of function ‘memcpy’
pywatchman/bser.c:226: warning: incompatible implicit declaration of built-in function ‘memcpy’
pywatchman/bser.c: In function ‘bser_init’:
pywatchman/bser.c:235: warning: implicit declaration of function ‘malloc’
pywatchman/bser.c:235: warning: incompatible implicit declaration of built-in function ‘malloc’
pywatchman/bser.c:245: error: too many arguments to function ‘bser_append’
pywatchman/bser.c: In function ‘bser_dtor’:
pywatchman/bser.c:252: warning: implicit declaration of function ‘free’
pywatchman/bser.c:252: warning: incompatible implicit declaration of built-in function ‘free’
pywatchman/bser.c:253: error: ‘NULL’ undeclared (first use in this function)
pywatchman/bser.c: At top level:
pywatchman/bser.c:256: error: expected declaration specifiers or ‘...’ before ‘int64_t’
pywatchman/bser.c: In function ‘bser_long’:
pywatchman/bser.c:258: error: ‘int8_t’ undeclared (first use in this function)
pywatchman/bser.c:258: error: expected ‘;’ before ‘i8’
pywatchman/bser.c:259: error: ‘int16_t’ undeclared (first use in this function)
pywatchman/bser.c:259: error: expected ‘;’ before ‘i16’
pywatchman/bser.c:260: error: ‘int32_t’ undeclared (first use in this function)
pywatchman/bser.c:260: error: expected ‘;’ before ‘i32’
pywatchman/bser.c:261: error: ‘int64_t’ undeclared (first use in this function)
pywatchman/bser.c:261: error: expected ‘;’ before ‘i64’
pywatchman/bser.c:263: error: ‘val’ undeclared (first use in this function)
pywatchman/bser.c:263: error: expected ‘)’ before ‘val’
pywatchman/bser.c:263: error: expected ‘)’ before ‘val’
pywatchman/bser.c:263: error: expected ‘)’ before ‘val’
pywatchman/bser.c:269: error: ‘i8’ undeclared (first use in this function)
pywatchman/bser.c:269: error: expected ‘;’ before ‘val’
pywatchman/bser.c:274: error: ‘i16’ undeclared (first use in this function)
pywatchman/bser.c:274: error: expected ‘;’ before ‘val’
pywatchman/bser.c:279: error: ‘i32’ undeclared (first use in this function)
pywatchman/bser.c:279: error: expected ‘;’ before ‘val’
pywatchman/bser.c:284: error: ‘i64’ undeclared (first use in this function)
pywatchman/bser.c:284: error: expected ‘;’ before ‘val’
pywatchman/bser.c:288: warning: implicit declaration of function ‘PyErr_SetString’
pywatchman/bser.c:288: error: ‘PyExc_RuntimeError’ undeclared (first use in this function)
pywatchman/bser.c:293: error: too many arguments to function ‘bser_append’
pywatchman/bser.c:297: error: too many arguments to function ‘bser_append’
pywatchman/bser.c: At top level:
pywatchman/bser.c:300: error: expected declaration specifiers or ‘...’ before ‘PyObject’
pywatchman/bser.c: In function ‘bser_string’:
pywatchman/bser.c:302: error: ‘NULL’ undeclared (first use in this function)
pywatchman/bser.c:303: error: ‘Py_ssize_t’ undeclared (first use in this function)
pywatchman/bser.c:303: error: expected ‘;’ before ‘len’
pywatchman/bser.c:305: error: ‘PyObject’ undeclared (first use in this function)
pywatchman/bser.c:305: error: ‘utf’ undeclared (first use in this function)
pywatchman/bser.c:307: warning: implicit declaration of function ‘PyUnicode_Check’
pywatchman/bser.c:307: error: ‘sval’ undeclared (first use in this function)
pywatchman/bser.c:308: warning: implicit declaration of function ‘PyUnicode_AsEncodedString’
pywatchman/bser.c:312: warning: implicit declaration of function ‘PyString_AsStringAndSize’
pywatchman/bser.c:312: error: ‘len’ undeclared (first use in this function)
pywatchman/bser.c:318: error: too many arguments to function ‘bser_append’
pywatchman/bser.c:323: error: too many arguments to function ‘bser_long’
pywatchman/bser.c:328: error: ‘UINT32_MAX’ undeclared (first use in this function)
pywatchman/bser.c:329: warning: implicit declaration of function ‘PyErr_Format’
pywatchman/bser.c:329: error: ‘PyExc_ValueError’ undeclared (first use in this function)
pywatchman/bser.c:334: error: ‘uint32_t’ undeclared (first use in this function)
pywatchman/bser.c:334: error: expected ‘)’ before ‘len’
pywatchman/bser.c:334: error: too many arguments to function ‘bser_append’
pywatchman/bser.c:338: warning: implicit declaration of function ‘Py_DECREF’
pywatchman/bser.c: At top level:
pywatchman/bser.c:344: error: expected declaration specifiers or ‘...’ before ‘PyObject’
pywatchman/bser.c: In function ‘bser_recursive’:
pywatchman/bser.c:346: warning: implicit declaration of function ‘PyBool_Check’
pywatchman/bser.c:346: error: ‘val’ undeclared (first use in this function)
pywatchman/bser.c:347: error: ‘Py_True’ undeclared (first use in this function)
pywatchman/bser.c:348: error: too many arguments to function ‘bser_append’
pywatchman/bser.c:350: error: too many arguments to function ‘bser_append’
pywatchman/bser.c:353: error: ‘Py_None’ undeclared (first use in this function)
pywatchman/bser.c:354: error: too many arguments to function ‘bser_append’
pywatchman/bser.c:357: warning: implicit declaration of function ‘PyInt_Check’
pywatchman/bser.c:358: warning: implicit declaration of function ‘PyInt_AS_LONG’
pywatchman/bser.c:358: error: too many arguments to function ‘bser_long’
pywatchman/bser.c:361: warning: implicit declaration of function ‘PyLong_Check’
pywatchman/bser.c:362: warning: implicit declaration of function ‘PyLong_AsLongLong’
pywatchman/bser.c:362: error: too many arguments to function ‘bser_long’
pywatchman/bser.c:365: warning: implicit declaration of function ‘PyString_Check’
pywatchman/bser.c:366: error: too many arguments to function ‘bser_string’
pywatchman/bser.c:370: warning: implicit declaration of function ‘PyFloat_Check’
pywatchman/bser.c:371: warning: implicit declaration of function ‘PyFloat_AS_DOUBLE’
pywatchman/bser.c:374: error: too many arguments to function ‘bser_append’
pywatchman/bser.c:378: error: too many arguments to function ‘bser_append’
pywatchman/bser.c:381: warning: implicit declaration of function ‘PyList_Check’
pywatchman/bser.c:382: error: ‘Py_ssize_t’ undeclared (first use in this function)
pywatchman/bser.c:382: error: expected ‘;’ before ‘i’
pywatchman/bser.c:384: error: too many arguments to function ‘bser_append’
pywatchman/bser.c:388: error: ‘len’ undeclared (first use in this function)
pywatchman/bser.c:388: error: too many arguments to function ‘bser_long’
pywatchman/bser.c:392: error: ‘i’ undeclared (first use in this function)
pywatchman/bser.c:393: error: ‘PyObject’ undeclared (first use in this function)
pywatchman/bser.c:393: error: ‘ele’ undeclared (first use in this function)
pywatchman/bser.c:393: warning: implicit declaration of function ‘PyList_GET_ITEM’
pywatchman/bser.c:395: error: too many arguments to function ‘bser_recursive’
pywatchman/bser.c:403: warning: implicit declaration of function ‘PyTuple_Check’
pywatchman/bser.c:404: error: expected ‘;’ before ‘i’
pywatchman/bser.c:406: error: too many arguments to function ‘bser_append’
pywatchman/bser.c:410: error: too many arguments to function ‘bser_long’
pywatchman/bser.c:415: warning: implicit declaration of function ‘PyTuple_GET_ITEM’
pywatchman/bser.c:417: error: too many arguments to function ‘bser_recursive’
pywatchman/bser.c:425: warning: implicit declaration of function ‘PyMapping_Check’
pywatchman/bser.c:426: error: expected ‘;’ before ‘len’
pywatchman/bser.c:427: error: expected ‘;’ before ‘pos’
pywatchman/bser.c:428: error: ‘key’ undeclared (first use in this function)
pywatchman/bser.c:428: warning: left-hand operand of comma expression has no effect
pywatchman/bser.c:430: error: too many arguments to function ‘bser_append’
pywatchman/bser.c:434: error: too many arguments to function ‘bser_long’
pywatchman/bser.c:438: warning: implicit declaration of function ‘PyDict_Next’
pywatchman/bser.c:438: error: ‘pos’ undeclared (first use in this function)
pywatchman/bser.c:439: error: too many arguments to function ‘bser_string’
pywatchman/bser.c:442: error: too many arguments to function ‘bser_recursive’
pywatchman/bser.c:450: error: ‘PyExc_ValueError’ undeclared (first use in this function)
pywatchman/bser.c: At top level:
pywatchman/bser.c:454: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pywatchman/bser.c:487: error: expected declaration specifiers or ‘...’ before ‘int64_t’
pywatchman/bser.c: In function ‘bunser_int’:
pywatchman/bser.c:491: error: ‘int8_t’ undeclared (first use in this function)
pywatchman/bser.c:491: error: expected ‘;’ before ‘i8’
pywatchman/bser.c:492: error: ‘int16_t’ undeclared (first use in this function)
pywatchman/bser.c:492: error: expected ‘;’ before ‘i16’
pywatchman/bser.c:493: error: ‘int32_t’ undeclared (first use in this function)
pywatchman/bser.c:493: error: expected ‘;’ before ‘i32’
pywatchman/bser.c:494: error: ‘int64_t’ undeclared (first use in this function)
pywatchman/bser.c:494: error: expected ‘;’ before ‘i64’
pywatchman/bser.c:510: error: ‘PyExc_ValueError’ undeclared (first use in this function)
pywatchman/bser.c:521: warning: incompatible implicit declaration of built-in function ‘memcpy’
pywatchman/bser.c:521: error: ‘i8’ undeclared (first use in this function)
pywatchman/bser.c:522: error: ‘val’ undeclared (first use in this function)
pywatchman/bser.c:525: error: ‘i16’ undeclared (first use in this function)
pywatchman/bser.c:529: error: ‘i32’ undeclared (first use in this function)
pywatchman/bser.c:533: error: ‘i64’ undeclared (first use in this function)
pywatchman/bser.c: At top level:
pywatchman/bser.c:542: error: expected declaration specifiers or ‘...’ before ‘int64_t’
pywatchman/bser.c: In function ‘bunser_string’:
pywatchman/bser.c:548: error: ‘len’ undeclared (first use in this function)
pywatchman/bser.c:548: error: too many arguments to function ‘bunser_int’
pywatchman/bser.c:553: error: ‘PyExc_ValueError’ undeclared (first use in this function)
pywatchman/bser.c: At top level:
pywatchman/bser.c:562: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pywatchman/bser.c:605: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pywatchman/bser.c:674: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pywatchman/bser.c:775: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pywatchman/bser.c:858: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pywatchman/bser.c:893: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pywatchman/bser.c:934: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bser_methods’
pywatchman/bser.c:941: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘initbser’
error: command 'gcc' failed with exit status 1
make[1]: *** [py-build] Error 1
make[1]: Leaving directory `/tmp/watchman'
make: *** [all] Error 2



Solution:
Install python-devel for Redhat/Centos
yum install python-devel
Install python-dev Ubuntu 
apt-get install python-dev

Find the files which are not owned by the specific user/group

 
find <path> ! -<user/group> -name <fileslist/filespath>
 

Find the files which are owned by the specific user/group

 
find <path> -<user/group> -name <fileslist/filespath>
 

Find the Orphan files and set the user/group

find <path> -nouser -exec chown root:apache {} \;

Install Docker Engine on CentOS

To get started with Docker Engine on CentOS, make sure you meet the prerequisites, then install Docker.

Prerequisites

OS requirements

To install Docker Engine, you need a maintained version of CentOS 7. Archived versions aren’t supported or tested.
The centos-extras repository must be enabled. This repository is enabled by default, but if you have disabled it, you need to re-enable it.
The overlay2 storage driver is recommended.

Uninstall old versions

Older versions of Docker were called docker or docker-engine. If these are installed, uninstall them, along with associated dependencies.
$ sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
It’s OK if yum reports that none of these packages are installed.
The contents of /var/lib/docker/, including images, containers, volumes, and networks, are preserved. The Docker Engine package is now called docker-ce.

Installation methods

You can install Docker Engine in different ways, depending on your needs:
  • Most users set up Docker’s repositories and install from them, for ease of installation and upgrade tasks. This is the recommended approach.
  • Some users download the RPM package and install it manually and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.
  • In testing and development environments, some users choose to use automated convenience scripts to install Docker.

Install using the repository

Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.

Set up the repository

Install the yum-utils package (which provides the yum-config-manager utility) and set up the stable repository.
$ sudo yum install -y yum-utils

$ sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
Optional: Enable the nightly or test repositories.
These repositories are included in the docker.repo file above but are disabled by default. You can enable them alongside the stable repository. The following command enables the nightly repository.
$ sudo yum-config-manager --enable docker-ce-nightly
To enable the test channel, run the following command:
$ sudo yum-config-manager --enable docker-ce-test
You can disable the nightly or test repository by running the yum-config-manager command with the --disable flag. To re-enable it, use the --enable flag. The following command disables the nightly repository.
$ sudo yum-config-manager --disable docker-ce-nightly
Learn about nightly and test channels.

Install Docker Engine

  1. Install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:
    $ sudo yum install docker-ce docker-ce-cli containerd.io
    
    If prompted to accept the GPG key, verify that the fingerprint matches 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35, and if so, accept it.
    Got multiple Docker repositories?
    If you have multiple Docker repositories enabled, installing or updating without specifying a version in the yum install or yum update command always installs the highest possible version, which may not be appropriate for your stability needs.
    Docker is installed but not started. The docker group is created, but no users are added to the group.
  2. To install a specific version of Docker Engine, list the available versions in the repo, then select and install:
    a. List and sort the versions available in your repo. This example sorts results by version number, highest to lowest, and is truncated:
    $ yum list docker-ce --showduplicates | sort -r
    
    docker-ce.x86_64  3:18.09.1-3.el7                     docker-ce-stable
    docker-ce.x86_64  3:18.09.0-3.el7                     docker-ce-stable
    docker-ce.x86_64  18.06.1.ce-3.el7                    docker-ce-stable
    docker-ce.x86_64  18.06.0.ce-3.el7                    docker-ce-stable
    
    The list returned depends on which repositories are enabled, and is specific to your version of CentOS (indicated by the .el7 suffix in this example).
    b. Install a specific version by its fully qualified package name, which is the package name (docker-ce) plus the version string (2nd column) starting at the first colon (:), up to the first hyphen, separated by a hyphen (-). For example, docker-ce-18.09.1.
    $ sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
    
    Docker is installed but not started. The docker group is created, but no users are added to the group.
  3. Start Docker.
    $ sudo systemctl start docker
    
  4. Verify that Docker Engine is installed correctly by running the hello-world image.
    $ 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.
Docker Engine is installed and running. You need to use sudo to run Docker commands. Continue to Linux postinstall to allow non-privileged users to run Docker commands and for other optional configuration steps.

Upgrade Docker Engine

To upgrade Docker Engine, follow the installation instructions, choosing the new version you want to install.

Install from a package

If you cannot use Docker’s repository to install Docker, you can download the .rpm file for your release and install it manually. You need to download a new file each time you want to upgrade Docker Engine.
  1. Go to https://download.docker.com/linux/centos/ and choose your version of CentOS. Then browse to x86_64/stable/Packages/ and download the .rpm file for the Docker version you want to install.
    Note: To install a nightly or test (pre-release) package, change the word stable in the above URL to nightly or test. Learn about nightly and test channels.
  2. Install Docker Engine, changing the path below to the path where you downloaded the Docker package.
    $ sudo yum install /path/to/package.rpm
    
    Docker is installed but not started. The docker group is created, but no users are added to the group.
  3. Start Docker.
    $ sudo systemctl start docker
    
  4. Verify that Docker Engine is installed correctly by running the hello-world image.
    $ 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.
Docker Engine is installed and running. You need to use sudo to run Docker commands. Continue to Post-installation steps for Linux to allow non-privileged users to run Docker commands and for other optional configuration steps.

Upgrade Docker Engine

To upgrade Docker Engine, download the newer package file and repeat the installation procedure, using yum -y upgrade instead of yum -y install, and pointing to the new file.

Install using the convenience script

Docker provides convenience scripts at get.docker.com and test.docker.com for installing edge and testing versions of Docker Engine - Community into development environments quickly and non-interactively. The source code for the scripts is in the docker-install repository. Using these scripts is not recommended for production environments, and you should understand the potential risks before you use them:
  • The scripts require root or sudo privileges to run. Therefore, you should carefully examine and audit the scripts before running them.
  • The scripts attempt to detect your Linux distribution and version and configure your package management system for you. In addition, the scripts do not allow you to customize any installation parameters. This may lead to an unsupported configuration, either from Docker’s point of view or from your own organization’s guidelines and standards.
  • The scripts install all dependencies and recommendations of the package manager without asking for confirmation. This may install a large number of packages, depending on the current configuration of your host machine.
  • The script does not provide options to specify which version of Docker to install, and installs the latest version that is released in the “edge” channel.
  • Do not use the convenience script if Docker has already been installed on the host machine using another mechanism.
This example uses the script at get.docker.com to install the latest release of Docker Engine - Community on Linux. To install the latest testing version, use test.docker.com instead. In each of the commands below, replace each occurrence of get with test.
Warning:
Always examine scripts downloaded from the internet before running them locally.
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh

<output truncated>
If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like:
  sudo usermod -aG docker your-user
Remember to log out and back in for this to take effect!
Warning:
Adding a user to the “docker” group grants them the ability to run containers which can be used to obtain root privileges on the Docker host. Refer to Docker Daemon Attack Surface for more information.
Docker Engine - Community is installed. It starts automatically on DEB-based distributions. On RPM-based distributions, you need to start it manually using the appropriate systemctl or service command. As the message indicates, non-root users can’t run Docker commands by default.
Note:
To install Docker without root privileges, see Run the Docker daemon as a non-root user (Rootless mode).
Rootless mode is currently available as an experimental feature.

Upgrade Docker after using the convenience script

If you installed Docker using the convenience script, you should upgrade Docker using your package manager directly. There is no advantage to re-running the convenience script, and it can cause issues if it attempts to re-add repositories which have already been added to the host machine.

Uninstall Docker Engine

  1. Uninstall the Docker Engine, CLI, and Containerd packages:
    $ sudo yum remove docker-ce docker-ce-cli containerd.io
    
  2. Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:
    $ sudo rm -rf /var/lib/docker
    
You must delete any edited configuration files manually.

Source:
https://docs.docker.com/engine/install/centos/ 

Python3 Installation on CentOS/Redhat 6 and 7

Download Python3 Software. 

Untar the file.
tar xvf Python-3.7.0.tgz
cd  Python-3.7.0

Now you need to run the ./configure tool to prepare the build: 
./configure --enable-optimizations --with-ensurepip=install --prefix=/app/python3

Next, compile the installation by using make. The -j option simply tells make to split the building into parallel steps to speed up the compilation. Even with the parallel builds, this step can take several minutes:

$ make -j 8

Next, you need to run the installation. You’ll use the altinstall target here in order to not overwrite the system’s version of Python. Since you’re installing Python into /usr/bin, you’ll need to run as root:

$ sudo make altinstall