Skip to content

Commit

Permalink
Merge pull request #2623 from cyberark/fix-extra-build-deps
Browse files Browse the repository at this point in the history
Remove dev dependencies after building gems
  • Loading branch information
micahlee authored Aug 5, 2022
2 parents 447eb7e + 6a53ea3 commit e43e839
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@ LABEL name="conjur-ubi" \
summary="Conjur UBI-based image" \
description="Conjur provides secrets management and machine identity for modern infrastructure."

RUN INSTALL_PKGS="gcc \
gcc-c++ \
git \
glibc-devel \
libxml2-devel \
libxslt-devel \
make \
openldap-clients \
tzdata" && \
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
# Aug 4, 2022: Temporarily install the updated kernel headers package from
# centos until the UBI repository is updated with a version that resolves
# CVE-2022-1012 and CVE-2022-32250.
yum install -y http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/kernel-headers-4.18.0-408.el8.x86_64.rpm && \
yum -y clean all --enablerepo='*'

# Create conjur user with one that has known gid / uid.
RUN groupadd -r conjur \
-g 777 && \
Expand Down Expand Up @@ -69,8 +52,28 @@ COPY Gemfile \
Gemfile.lock ./
COPY gems/ gems/

# Install package dependencies for Conjur
RUN INSTALL_PKGS="openldap-clients \
tzdata" && \
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum -y clean all --enablerepo='*'

RUN bundle --without test development
# Install Gems (and build native gems) for Conjur
RUN INSTALL_PKGS="gcc \
gcc-c++ \
git \
glibc-devel \
libxml2-devel \
libxslt-devel \
make" && \
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
# Install the gems dependencies
bundle --without test development && \
# Remove the build packages
yum remove -y $INSTALL_PKGS && \
yum -y clean all --enablerepo='*'

COPY . .

Expand Down

0 comments on commit e43e839

Please sign in to comment.