Skip to content

Commit

Permalink
Break intermediate image stage as base and compiled
Browse files Browse the repository at this point in the history
  • Loading branch information
diegogslomp committed Aug 12, 2024
1 parent d5baad1 commit 01125f5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 236 deletions.
60 changes: 5 additions & 55 deletions dockerfiles/almalinux
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM almalinux:9 AS intermediate
FROM almalinux:9 AS base

RUN yum update -y && \
yum install epel-release yum-utils -y && \
Expand Down Expand Up @@ -52,6 +52,8 @@ RUN yum update -y && \
zlib-devel \
-y && yum clean all -y

FROM base AS compiled

WORKDIR /usr/local/src
COPY samba.tar.gz samba.tar.gz
RUN mkdir samba && \
Expand All @@ -62,66 +64,14 @@ RUN ./configure && \
make -j 3 && \
make install

FROM almalinux:9

RUN yum update -y && \
yum install epel-release yum-utils -y && \
yum config-manager --enable epel && \
yum config-manager --set-enabled crb && \
yum install \
bind-utils \
bison \
dbus-devel \
docbook-style-xsl \
flex \
gcc \
gdb \
gnutls-devel \
gpgme-devel \
hostname \
iproute \
jansson-devel \
jq \
keyutils-libs-devel \
krb5-workstation \
libacl-devel \
libaio-devel \
libarchive-devel \
libattr-devel \
libblkid-devel \
libtasn1 \
libtasn1-tools \
libtirpc-devel \
libxml2-devel \
libxslt \
lmdb-devel \
netcat \
openldap-clients \
openldap-devel \
pam-devel \
perl \
perl-ExtUtils-MakeMaker \
perl-JSON \
perl-Parse-Yapp \
popt-devel \
python3-cryptography \
python3-devel \
python3-dns \
python3-gpg \
python3-markdown \
readline-devel \
rpcgen \
systemd-devel \
tar \
zlib-devel \
-y && yum clean all -y
FROM base

ENV PATH /usr/local/samba/bin:/usr/local/samba/sbin:$PATH
ENV LC_CTYPE C.UTF-8
ENV LC_MESSAGES C.UTF-8
ENV LC_ALL C.UTF-8

COPY --from=intermediate /usr/local/samba /usr/local/samba
COPY --from=compiled /usr/local/samba /usr/local/samba

WORKDIR /usr/local/sbin
COPY sbin /usr/local/sbin
Expand Down
68 changes: 5 additions & 63 deletions dockerfiles/debian
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian AS intermediate
FROM debian AS base

RUN apt update && apt upgrade -y && \
DEBIAN_FRONTEND=noninteractive \
Expand Down Expand Up @@ -60,6 +60,8 @@ RUN apt update && apt upgrade -y && \
-y && apt clean autoclean && \
apt autoremove -y

FROM base AS compiled

WORKDIR /usr/local/src
COPY samba.tar.gz samba.tar.gz
RUN mkdir samba && \
Expand All @@ -70,74 +72,14 @@ RUN ./configure && \
make -j 3 && \
make install

FROM debian

RUN apt update && apt upgrade -y && \
DEBIAN_FRONTEND=noninteractive \
apt install \
acl \
attr \
autoconf \
bind9utils \
bison \
build-essential \
curl \
debhelper \
dnsutils \
docbook-xml \
docbook-xsl \
flex \
gdb \
iproute2 \
iputils-ping \
jq \
krb5-user \
ldap-utils \
libacl1-dev \
libaio-dev \
libarchive-dev \
libattr1-dev \
libblkid-dev \
libbsd-dev \
libcap-dev \
libcups2-dev \
libdbus-1-dev \
libgnutls28-dev \
libgpgme-dev \
libjansson-dev \
libjson-perl \
libldap2-dev \
liblmdb-dev \
libncurses5-dev \
libpam0g-dev \
libparse-yapp-perl \
libpopt-dev \
libreadline-dev \
lmdb-utils \
netcat-traditional \
nettle-dev \
perl \
perl-modules \
pkg-config \
python3-all-dev \
python3-cryptography \
python3-dbg \
python3-dev \
python3-dnspython \
python3-gpg \
python3-markdown \
vim \
xsltproc \
zlib1g-dev \
-y && apt clean autoclean && \
apt autoremove -y
FROM base

ENV PATH /usr/local/samba/bin:/usr/local/samba/sbin:$PATH
ENV LC_CTYPE C.UTF-8
ENV LC_MESSAGES C.UTF-8
ENV LC_ALL C.UTF-8

COPY --from=intermediate /usr/local/samba /usr/local/samba
COPY --from=compiled /usr/local/samba /usr/local/samba

WORKDIR /usr/local/sbin
COPY sbin /usr/local/sbin
Expand Down
60 changes: 5 additions & 55 deletions dockerfiles/rockylinux
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rockylinux:9 AS intermediate
FROM rockylinux:9 AS base

RUN yum update -y && \
yum install epel-release yum-utils -y && \
Expand Down Expand Up @@ -52,6 +52,8 @@ RUN yum update -y && \
zlib-devel \
-y && yum clean all -y

FROM base AS compiled

WORKDIR /usr/local/src
COPY samba.tar.gz samba.tar.gz
RUN mkdir samba && \
Expand All @@ -62,66 +64,14 @@ RUN ./configure && \
make -j 3 && \
make install

FROM rockylinux:9

RUN yum update -y && \
yum install epel-release yum-utils -y && \
yum config-manager --enable epel && \
yum config-manager --set-enabled crb && \
yum install \
bind-utils \
bison \
dbus-devel \
docbook-style-xsl \
flex \
gcc \
gdb \
gnutls-devel \
gpgme-devel \
hostname \
iproute \
jansson-devel \
jq \
keyutils-libs-devel \
krb5-workstation \
libacl-devel \
libaio-devel \
libarchive-devel \
libattr-devel \
libblkid-devel \
libtasn1 \
libtasn1-tools \
libtirpc-devel \
libxml2-devel \
libxslt \
lmdb-devel \
netcat \
openldap-clients \
openldap-devel \
pam-devel \
perl \
perl-ExtUtils-MakeMaker \
perl-JSON \
perl-Parse-Yapp \
popt-devel \
python3-cryptography \
python3-devel \
python3-dns \
python3-gpg \
python3-markdown \
readline-devel \
rpcgen \
systemd-devel \
tar \
zlib-devel \
-y && yum clean all -y
FROM base

ENV PATH /usr/local/samba/bin:/usr/local/samba/sbin:$PATH
ENV LC_CTYPE C.UTF-8
ENV LC_MESSAGES C.UTF-8
ENV LC_ALL C.UTF-8

COPY --from=intermediate /usr/local/samba /usr/local/samba
COPY --from=compiled /usr/local/samba /usr/local/samba

WORKDIR /usr/local/sbin
COPY sbin /usr/local/sbin
Expand Down
68 changes: 5 additions & 63 deletions dockerfiles/ubuntu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu AS intermediate
FROM ubuntu AS base

RUN apt update && apt upgrade -y && \
DEBIAN_FRONTEND=noninteractive \
Expand Down Expand Up @@ -60,6 +60,8 @@ RUN apt update && apt upgrade -y && \
-y && apt clean autoclean && \
apt autoremove -y

FROM base AS compiled

WORKDIR /usr/local/src
COPY samba.tar.gz samba.tar.gz
RUN mkdir samba && \
Expand All @@ -70,74 +72,14 @@ RUN ./configure && \
make -j 3 && \
make install

FROM ubuntu

RUN apt update && apt upgrade -y && \
DEBIAN_FRONTEND=noninteractive \
apt install \
acl \
attr \
autoconf \
bind9utils \
bison \
build-essential \
curl \
debhelper \
dnsutils \
docbook-xml \
docbook-xsl \
flex \
gdb \
iproute2 \
iputils-ping \
jq \
krb5-user \
ldap-utils \
libacl1-dev \
libaio-dev \
libarchive-dev \
libattr1-dev \
libblkid-dev \
libbsd-dev \
libcap-dev \
libcups2-dev \
libdbus-1-dev \
libgnutls28-dev \
libgpgme-dev \
libjansson-dev \
libjson-perl \
libldap2-dev \
liblmdb-dev \
libncurses5-dev \
libpam0g-dev \
libparse-yapp-perl \
libpopt-dev \
libreadline-dev \
lmdb-utils \
netcat-traditional \
nettle-dev \
perl \
perl-modules \
pkg-config \
python3-all-dev \
python3-cryptography \
python3-dbg \
python3-dev \
python3-dnspython \
python3-gpg \
python3-markdown \
vim \
xsltproc \
zlib1g-dev \
-y && apt clean autoclean && \
apt autoremove -y
FROM base

ENV PATH /usr/local/samba/bin:/usr/local/samba/sbin:$PATH
ENV LC_CTYPE C.UTF-8
ENV LC_MESSAGES C.UTF-8
ENV LC_ALL C.UTF-8

COPY --from=intermediate /usr/local/samba /usr/local/samba
COPY --from=compiled /usr/local/samba /usr/local/samba

WORKDIR /usr/local/sbin
COPY sbin /usr/local/sbin
Expand Down

0 comments on commit 01125f5

Please sign in to comment.