GithubHelp home page GithubHelp logo

openldap-bcrypt-docker's Introduction

openldap-bcrypt-docker's People

Contributors

elgohr avatar howardlau1999 avatar nesc58 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

openldap-bcrypt-docker's Issues

Lot of layers in Dockerfile

Hi,
there are lot of layers created through the provided dockerfile.

What do you think about a multistage dockerfile?

I have build something like the following

########################
# Build Stage
########################
FROM debian:buster-slim as builder

## Configuration
########################
ARG OPENLDAP_BUILD_VERSION=OPENLDAP_REL_ENG_2_4_50
ARG OPENLDAP_BCRYPT_VERSION=master
ARG BCRYPT_DEFAULT_WORKFACTOR=10
ARG MAKE_BUILD_JOBS=8

## Prepare
########################
# Install build tools
RUN apt-get update && apt-get -y install apt-utils git man-db libdb5.3-dev libssl-dev autoconf build-essential libtool libldap2-dev
# Create output directory
RUN mkdir /libtocopy
# Build openldap
RUN git clone --branch ${OPENLDAP_BUILD_VERSION} --depth 1 https://git.openldap.org/openldap/openldap.git openldap
WORKDIR /openldap
RUN ./configure --enable-modules
RUN make depend
RUN make --jobs ${MAKE_BUILD_JOBS}

## Build BCRYPT module
########################
WORKDIR /openldap/contrib/slapd-modules/passwd
RUN git clone --branch ${OPENLDAP_BCRYPT_VERSION} --depth 1 https://github.com/wclarie/openldap-bcrypt.git bcrypt
WORKDIR /openldap/contrib/slapd-modules/passwd/bcrypt
RUN sed -i "s/#define BCRYPT_DEFAULT_WORKFACTOR [[:digit:]]\+/#define BCRYPT_DEFAULT_WORKFACTOR $BCRYPT_DEFAULT_WORKFACTOR/g" pw-bcrypt.c
RUN make --jobs ${MAKE_BUILD_JOBS}
RUN cp pw-bcrypt.la .libs/pw-bcrypt.so .libs/pw-bcrypt.so.0 .libs/pw-bcrypt.so.0.0.0 /libtocopy
WORKDIR /openldap

########################
# RUN Stage
########################
FROM osixia/openldap:1.4.0
# Copy modules from build to productive image
COPY --from=builder /libtocopy /usr/lib/ldap/
ADD bootstrap/ldif/custom/*.ldif /container/service/slapd/assets/config/bootstrap/ldif/custom/

So, only the compiled bcrypt modules will be added to the pushed image. This will reduce the image size a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.