169 lines
4.4 KiB
Groff
169 lines
4.4 KiB
Groff
.nh
|
|
.TH OpenShift base images
|
|
.PP
|
|
This repository contains Dockerfiles for images which serve as base images with all the
|
|
essential libraries and tools needed for OpenShift language images, for example:
|
|
|
|
.RS
|
|
.IP \(bu 2
|
|
s2i\-ruby
|
|
\[la]https://github.com/sclorg/s2i-ruby-container\[ra]
|
|
.IP \(bu 2
|
|
s2i\-nodejs
|
|
\[la]https://github.com/sclorg/s2i-nodejs-container\[ra]
|
|
.IP \(bu 2
|
|
s2i\-python
|
|
\[la]https://github.com/sclorg/s2i-python-container\[ra]
|
|
.IP \(bu 2
|
|
s2i\-perl
|
|
\[la]https://github.com/sclorg/s2i-perl-container\[ra]
|
|
.IP \(bu 2
|
|
s2i\-php
|
|
\[la]https://github.com/sclorg/s2i-php-container\[ra]
|
|
|
|
.RE
|
|
|
|
.PP
|
|
This container image also installs several development libraries, that are
|
|
often required in the builder images above. It also includes NPM package manager.
|
|
Sharing those development packages in a common layer saves disk space and
|
|
improves pulling speed.
|
|
|
|
.PP
|
|
NPM, a package manager for Node.js, offers a pleasant way to install JavaScript
|
|
libraries, that are often needed as static files for various web applications.
|
|
In order to offer good experience for web developers, the NPM package manager
|
|
is also installed in the image.
|
|
|
|
.PP
|
|
For containers where the development libraries and NPM package manager are not
|
|
necessary, users are advised to use the s2i\-core variant of this container image.
|
|
|
|
.SH Description
|
|
.PP
|
|
OpenShift S2I images use Software Collections
|
|
\[la]https://www.softwarecollections.org/en/\[ra]
|
|
packages to provide the latest versions of various software.
|
|
The SCL packages are released more frequently than the RHEL or CentOS systems,
|
|
which are unlikely to change for several years.
|
|
We rely on RHEL and CentOS for base images, on the other hand,
|
|
because those are stable, supported, and secure platforms.
|
|
|
|
.PP
|
|
Normally, SCL requires manual operation to enable the collection you want to use.
|
|
This is burdensome and can be prone to error.
|
|
The OpenShift S2I approach is to set Bash environment variables that
|
|
serve to automatically enable the desired collection:
|
|
|
|
.RS
|
|
.IP \(bu 2
|
|
\fB\fCBASH\_ENV\fR: enables the collection for all non\-interactive Bash sessions
|
|
.IP \(bu 2
|
|
\fB\fCENV\fR: enables the collection for all invocations of \fB\fC/bin/sh\fR
|
|
.IP \(bu 2
|
|
\fB\fCPROMPT\_COMMAND\fR: enables the collection in interactive shell
|
|
|
|
.RE
|
|
|
|
.PP
|
|
Two examples:
|
|
* If you specify \fB\fCBASH\_ENV\fR, then all your \fB\fC#!/bin/bash\fR scripts
|
|
do not need to call \fB\fCscl enable\fR\&.
|
|
* If you specify \fB\fCPROMPT\_COMMAND\fR, then on execution of the
|
|
\fB\fCpodman exec ... /bin/bash\fR command, the collection will be automatically enabled.
|
|
|
|
.PP
|
|
\fINote\fP:
|
|
Executables in Software Collections packages (e.g., \fB\fCruby\fR)
|
|
are not directly in a directory named in the \fB\fCPATH\fR environment variable.
|
|
This means that you cannot do:
|
|
|
|
.PP
|
|
.RS
|
|
|
|
.nf
|
|
$ podman exec <cid> ... ruby
|
|
|
|
.fi
|
|
.RE
|
|
|
|
.PP
|
|
but must instead do:
|
|
|
|
.PP
|
|
.RS
|
|
|
|
.nf
|
|
$ podman exec <cid> ... /bin/bash \-c ruby
|
|
|
|
.fi
|
|
.RE
|
|
|
|
.PP
|
|
The \fB\fC/bin/bash \-c\fR, along with the setting the appropriate environment variable,
|
|
ensures the correct \fB\fCruby\fR executable is found and invoked.
|
|
|
|
.PP
|
|
Note: while the examples in this README are calling \fB\fCpodman\fR, you can replace any such calls by \fB\fCdocker\fR with the same arguments
|
|
|
|
.SH Usage
|
|
.PP
|
|
Choose either the CentOS7 or RHEL7 base image:
|
|
* \fBRHEL7 base image\fP
|
|
|
|
.PP
|
|
To build a RHEL7 based image, you need to build it on properly subscribed RHEL machine.
|
|
|
|
.PP
|
|
.RS
|
|
|
|
.nf
|
|
$ git clone \-\-recursive https://github.com/sclorg/s2i\-base\-container.git
|
|
$ cd s2i\-base\-container
|
|
$ make build VERSIONS=base TARGET=rhel7
|
|
|
|
.fi
|
|
.RE
|
|
|
|
.RS
|
|
.IP \(bu 2
|
|
\fBCentOS7 base image\fP
|
|
|
|
.RE
|
|
|
|
.PP
|
|
This image is available on DockerHub. To download it run:
|
|
|
|
.PP
|
|
.RS
|
|
|
|
.nf
|
|
podman pull quay.io/centos7/s2i\-base\-centos7
|
|
|
|
.fi
|
|
.RE
|
|
|
|
.PP
|
|
To build a Base image from scratch run:
|
|
|
|
.PP
|
|
.RS
|
|
|
|
.nf
|
|
$ git clone \-\-recursive https://github.com/sclorg/s2i\-base\-container.git
|
|
$ cd s2i\-base\-container
|
|
$ make build VERSIONS=base
|
|
|
|
.fi
|
|
.RE
|
|
|
|
.PP
|
|
\fBNotice: By omitting the \fB\fCVERSION\fR parameter, the build/test action will be performed
|
|
on all provided versions of s2i image.\fP
|
|
|
|
.SH See also
|
|
.PP
|
|
Dockerfile and other sources are available on https://github.com/sclorg/s2i\-base\-container.
|
|
In that repository you also can find another variants of S2I base Dockerfiles.
|
|
The Dockerfile for CentOS is called Dockerfile, the Dockerfile for RHEL7 is called Dockerfile.rhel7,
|
|
the Dockerfile for RHEL8 is called Dockerfile.rhel8 and the Dockerfile for Fedora is Dockerfile.fedora.
|