All Projects → SUSE → sle2docker

SUSE / sle2docker

Licence: MIT license
This is a tool which facilitates the creation of SLE containers for Docker.

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to sle2docker

spec-cleaner
spec-cleaner
Stars: ✭ 26 (-33.33%)
Mutual labels:  rpm, suse
obs-docu
Official Open Build Service Documentation. Content gets reviewed and edited. Generated books are available at http://www.openbuildservice.org
Stars: ✭ 26 (-33.33%)
Mutual labels:  rpm, suse
obs-service-go modules
OBS Source Service to download, verify, and vendor Go module dependency sources
Stars: ✭ 18 (-53.85%)
Mutual labels:  rpm
st2-packages
StackStorm deb/rpm packages (automated docker build pipeline)
Stars: ✭ 25 (-35.9%)
Mutual labels:  rpm
copr-rpm-spec
My RPM specs on Copr
Stars: ✭ 17 (-56.41%)
Mutual labels:  rpm
wacom-gui
Python/PyQt Wacom GUI for KDE
Stars: ✭ 113 (+189.74%)
Mutual labels:  rpm
Boostnote-packages
Repo containing .rpm, .deb and Boostnote app folder
Stars: ✭ 31 (-20.51%)
Mutual labels:  rpm
distrobox
Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
Stars: ✭ 4,371 (+11107.69%)
Mutual labels:  suse
LAMPP-Manager
A simple LAMPP manager designed to automate all the work.
Stars: ✭ 117 (+200%)
Mutual labels:  rpm
nginx-more
Development repository for nginx-more package
Stars: ✭ 96 (+146.15%)
Mutual labels:  rpm
deezer-linux
An universal linux port of deezer, supporting both Flatpak and AppImage
Stars: ✭ 141 (+261.54%)
Mutual labels:  rpm
awx-rpm
RPM specs for ansible-awx project
Stars: ✭ 41 (+5.13%)
Mutual labels:  rpm
holo-build
Cross-distribution system package compiler
Stars: ✭ 43 (+10.26%)
Mutual labels:  rpm
prometheus-rpm
RPM packages for Prometheus
Stars: ✭ 35 (-10.26%)
Mutual labels:  rpm
libdnf
Package management library.
Stars: ✭ 157 (+302.56%)
Mutual labels:  rpm
copr-build-bazel
copr build of bazel | https://copr.fedorainfracloud.org/coprs/vbatts/bazel/
Stars: ✭ 14 (-64.1%)
Mutual labels:  rpm
doc-ses
Official SUSE Enterprise Storage documentation
Stars: ✭ 14 (-64.1%)
Mutual labels:  suse
rpm-rs
A pure rust library for building and parsing RPM's
Stars: ✭ 32 (-17.95%)
Mutual labels:  rpm
rpm-adapter
Turns your data storage into an RPM repository
Stars: ✭ 21 (-46.15%)
Mutual labels:  rpm
ATtiny13-TinyTacho
Simple RPM-Meter
Stars: ✭ 36 (-7.69%)
Mutual labels:  rpm

Build Status Code Climate Test Coverage

sle2docker is a convenience tool which imports the pre-built SUSE Linux Enterprise images for Docker.

The tool takes advantage of pre-built Docker images distributed by SUSE to create the base Docker image that users can later customize using Docker's integrated build system. The pre-built images are distributed by SUSE as RPMs.

Pre-built images do not have repositories configured but zypper will automatically have access to the right repositories when the Docker host has a SLE subscription that provides access to the product used in the image. For more details read the "Customizing the images" section below.

Previous versions of the tool built the Docker images from KIWI templates distributed by SUSE. This is no longer possible.

Requirements

Ruby is required to execute the sle2docker program.

Docker must be running on the system and the user invoking sle2docker must have the rights to interact with it.

Installation

The recommended way to install sle2docker is via zypper:

sudo zypper in sle2docker

However sle2docker can also be installed via gem:

sudo gem install --no-format-exec sle2docker

The --no-format-exec is recommended otherwise the sle2docker binary will be prefixed with the ruby version installed on the system (e.g.: the binary on SLE12 would be called sle2docker.ruby2.1).

Usage

To list the available pre-built images use the following command:

sle2docker list
Available pre-built images:
 - sles11sp3-docker.x86_64-1.0.0-Build1.3
 - sles12-docker.x86_64-1.0.0-Build7.4

To activate the pre-built image use the following command:

sle2docker activate IMAGE_NAME

Customizing the images

To create custom Docker images based on the official ones use Docker's integrated build system.

The pre-built images do not have any repository configured. They contain a zypper service that contacts either the SUSE Customer Center (SCC) or your Subscription Management Tool (SMT) server according to the configuration of the SLE host running the Docker container. The service obtains the list of repositories available for the product used by the Docker image.

There is no need to add any credential to the Docker image because the machine credentials are automatically injected into the container by the docker daemon. These are injected inside of the /run/secrets directory. The same applies to the /etc/SUSEConnect file of the host system, which is automatically injected into the /run/secrets.

The contents of the /run/secrets directory are never committed to a Docker image, hence there's no risk of leaking your credentials.

To obtain the list of repositories invoke:

zypper ref -s

This will automatically add all the repositories to your container. For each repository added to the system a new file is going to be created under /etc/zypp/repos.d. The URLs of these repositories include an access token that automatically expires after 12 hours. To renew the token just call the zypper ref -s command. It is totally fine, and secure, to commit these files to a Docker image.

If you want to use a different set of credentials, place a custom /etc/zypp/credentials.d/SCCcredentials with the machine credentials having the subscription you want to use inside of the Docker image. The same applies to the SUSEConnect file: if you want to override the one available on the host system running the Docker container you have to add a custom /etc/SUSEConnect file inside of the Docker image.

Creating a custom SLE12 image

This Dockerfile creates a simple Docker image based on SLE12:

FROM suse/sles12:latest

RUN zypper ref -s
RUN zypper -n in vim

When the Docker host machine is registered against an internal SMT server the Docker image requires the ssl certificate used by SMT:

FROM suse/sles12:latest

# Import the crt file of our private SMT server
ADD http://smt.test.lan/smt.crt /etc/pki/trust/anchors/smt.crt
RUN update-ca-certificates

RUN zypper ref -s
RUN zypper -n in vim

Creating a custom SLE11SP3 image

This Dockerfile creates a simple Docker image based on SLE11:

FROM suse/sles11sp3:latest

RUN zypper ref -s
RUN zypper -n in vim

When the Docker host machine is registered against an internal SMT server the Docker image requires the ssl certificate used by SMT:

FROM suse/sles11sp3:latest

# Import the crt file of our private SMT server
ADD http://smt.test.lan/smt.crt /etc/ssl/certs/smt.pem
RUN c_rehash /etc/ssl/certs

RUN zypper ref -s
RUN zypper -n in vim

Additional documentation

For more information visit the SUSE's Docker documentation page.

License

sle2docker is released under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].