We use Docker versions on both RHEL and CentOS, but when we do so, we do it on the current editions of RHEL and CentOS and it works (in our environment) well under those conditions. Installing applications (especially third-party, etc on an OS of four minor versions older than the current supported OS will likely not result in a smooth experience. Creating a local docker registry on CentOS 7 is a matter of following few steps. For installation of Docker on different distributions refer to How to install Docker CE on Linux Systems. Step 1: Install Docker CE on CentOS 7. We’ll use registry 2 Docker image to create a running instance of Docker registry on CentOS 7.
RHEL 7 offers another utility to configure and display date and time information, timedatectl. This utility is part of the systemd system and service manager. With the timedatectl command you can :
- Change the current date and time
- Set the time zone
- Configure NTP
If you run timedatectl without any options, you would get an output similar to below :
The above output shows – local time, universal time, RTC time, time zone, NTP configuration and Daylight Savings Time (DST)
Change the current date and time
Use the set-time argument to change the current date and the current time.
1. To change the date, use the following syntax:
2. To change the current time, use the following syntax. Enter the hour by using a 24-hour clock.
3. To configure your system to maintain the clock in the local time, use the following command:
4. To configure your system to use UTC, use the following command:
Change Time Zone
Use the following command to list all available time zones:
Use the set-timezone argument to change the time zone. The following example changes the time zone to Asia/Kolkata:
Use the set-ntp argument to enable or disable automatic synchronization of your system clock with a remote server over the Network Time Protocol (NTP). Use the following command to enable this feature:
Use the following command to disable this automatic synchronization over NTP:
'Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment.' - docker.com/what-docker
Installation and configuration
CERN CentOS 7 provides two versions of docker:
- docker - stable version 1.10 with backported patches.
- docker-latest - latest version updated periodically - 1.13 (Apr 2017).
Update Docker Centos 7 Latest
To install run on your system as root:
Note: While two above versions can be installed in parallel, only one can be usedon the system at any given time (different data storage paths, different system services started).
To configure and start docker system service run:and run docker using:
Update Docker Centos 7 64-bit
To configure and start docker-latest system service run:and in addition edit /etc/sysconfig/dockeradding a line:and run docker using:
CERN base imagesWe provide (and regularily update) prebuiltDocker images for: Scientific Linux CERN 5, Scientific Linux CERN 6 and CERN CentOS 7.
Please see: CERN Docker images for information.
Building layered image using CERN base imageFor full documentation about building images please refer to Docker documentation. Docker session below shows only how to build/push a simple layered image.
- Pull base image from registry:
- List images:
- Create a Dockerfile in subdirectory: containing:
- Start build:
- List images:
- Test your image:
- Tag the image:
- And push it to registry (note: the registry must be preconfigured in GitLab first):