We’re excited to announce our latest step in the further optimizing of Red Hat Enterprise Linux (RHEL) for containers with the release of the RHEL Atomic base image. This image is much smaller than the current RHEL base image, giving just enough to get started on building your application or service.
We carved out python, systemd, and yes, even Yum is gone - leaving you with only the bare bone essentials like glibc, rpm, bash, and their remaining dependencies. This leaves us with an image that’s just under 30MB compressed, 75MB on disk; composed of 81 packages.
Does size matter? For containers, the answer is it might
There’s a lot of hype in the industry around tiny base images such as Busybox, Alpine, or even static linking binaries from “scratch.” On one hand it’s really fun to work with such a tiny, embedded feeling footprint that is lightning fast to transfer over the network. On the other, some of our testing with these images shows that once these get loaded up with application stacks, they don’t always end up saving as much space as you’d think.
Regardless of the base images chosen in your environment, we strongly recommend standardizing on as few as possible and being disciplined in your build processes in order to reuse as many image layers as possible. Platforms like OpenShift tend to encourage this type of behavior by design, and it results in much smaller deltas being transferred to hosts when they pull containers. This is really important for full scale production environments.
Apart from the general “image hygiene” that we recommend, there are times where smaller images are beneficial. For example, highly dispersed environments like IoT and retail often have bandwidth limitations and can benefit from a reduced base image.
Most importantly, applications written in languages like Java or Go that bundle dependencies, often only require a handful of libraries - albeit crucial ones. We worked hard to strike the right balance with this image being small while simultaneously providing availability to the entire Red Hat ecosystem of content and management tools.
Introducing Microdnf
Earlier we mentioned that Yum has been removed, but don’t panic! We’re including a new, miniature version called microdnf, tailored specifically for containers.
Microdnf handles all of the common operations needed in a container like install, update, remove, etc., plus it’s written in C and allows us to be incredibly efficient moving forward. It’s also based on the underlying technology that our next version of YUM will leverage.
Remember, Microdnf is not a full yum replacement, but it’s perfectly suited for the container use case. On “pet” systems where you want a fully interactive package manager, yum is what you need. When you’re building a container, though, you really only need to handle a few package operations to create and deploy a container.
Adapting Dockerfiles
Using microdnf is simple. Let’s start with an existing dockerfile and adjust the relevant sections for the Atomic Base Image.
FROM registry.access.redhat.com/rhel7
RUN yum-config-manager --enable rhel-7-server-rpms
RUN yum install -y --setopt=tsflags=nodocs java-1.8.0-openjdk-headless ;\
yum clean all
With the Atomic Base Image this becomes:
FROM registry.access.redhat.com/rhel7-atomic
RUN microdnf --enablerepo=rhel-7-server-rpms \
install java-1.8.0-openjdk-headless --nodocs ;\
microdnf clean all
As you can see in this example, we collapsed the repository configuration into the install command for microdnf. This will be the default behavior when the container host is registered via subscription-manager. Alternatively, we could simply use a standard .repo file under /etc/yum.repos.d/ to configure this for us.
More to come!
We hope you enjoy using the new Atomic Base Image and find it as useful as we have. Also, don’t think we’re anywhere close to being done innovating with our container images!
Upstream we have several other efforts in the works that will continue our minimization effort, additional base images geared toward enabling monolithic applications, and ways to deliver more trusted and supported application stacks with life cycles that enterprises can depend on.
You can find the rest of Red Hat’s enterprise-ready images on the Red Hat Container Catalog, but be sure to take the Atomic Image out for a spin today!
저자 소개
Joe Brockmeier is the editorial director of the Red Hat Blog. He also acts as Vice President of Marketing & Publicity for the Apache Software Foundation.
Brockmeier joined Red Hat in 2013 as part of the Open Source and Standards (OSAS) group, now the Open Source Program Office (OSPO). Prior to Red Hat, Brockmeier worked for Citrix on the Apache OpenStack project, and was the first OpenSUSE community manager for Novell between 2008-2010.
He also has an extensive history in the tech press and publishing, having been editor-in-chief of Linux Magazine, editorial director of Linux.com, and a contributor to LWN.net, ZDNet, UnixReview.com, and many others.
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.