Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include bcrypt in base image #52

Closed
bdlamprecht opened this issue Jan 15, 2018 · 2 comments
Closed

Include bcrypt in base image #52

bdlamprecht opened this issue Jan 15, 2018 · 2 comments

Comments

@bdlamprecht
Copy link

Hey, its me again... 馃槉
I've discovered that I need the python package bcrypt>=3.1.3 which requires it to be compiled during the build stage.

While looking into the Dockerfile more closely, I see the that you also compile a number of python packages as well.

From the file base.Dockerfile:

# Install some required python modules which need compiling
    apk add --no-cache gcc=6.3.0-r4\
                       musl=1.1.16-r13\
                       musl-dev=1.1.16-r13\
                       musl-utils=1.1.16-r13\
                       binutils-libs=2.28-r2\
                       binutils=2.28-r2\
                       isl=0.17.1-r0\
                       libgomp=6.3.0-r4\
                       libatomic=6.3.0-r4\
                       pkgconf=1.3.7-r0\
                       libgcc=6.3.0-r4\
                       mpfr3=3.1.5-r0\
                       mpc1=1.0.3-r0\
                       libstdc++=6.3.0-r4\
                       zlib-dev=1.2.11-r0\
                       python2-dev=2.7.13-r1\
                       openssl-dev=1.0.2k-r0\
                       libffi-dev=3.2.1-r3\
                       libxml2-dev=2.9.4-r4\
                       libxslt-dev=1.1.29-r3 &&\

What could I do to convince you to add bcrypt as well?

Alternatively, if you're against that for what ever reason, I'm wondering if you could provide a way for the user to define which packages need to be compiled and included? I have a feeling that would be somewhat more difficult to implement correctly, but thought I would ask anyways.

As always, I'm truly grateful for the help! 馃槃

@udondan
Copy link
Collaborator

udondan commented Jan 22, 2018

As always, sorry for the delay...

I'm not in general against adding bcrypt to the base image. The problem here lies more in the apline packages, which only are available in their latest version - the reason why the base image exists in the first place. When building a new base image all package versions would need to be updated to the latest available, which at very least would bring Silo to version 3. We can add bcrypt later when we need to re-build the base image for other reasons.

But, good news! The solution for your problem is actually quite simnple.

If you need bcrypt in general, you can install it like this:

  1. Open a shell
    ansible-silo --shell
  2. Install build requiremtns
    sudo apk add --no-cache gcc libffi-dev python2-dev musl musl-dev musl-utils
  3. Install bcrypt
    pip install bcrypt>=3.1.3

No need to clean up behind you. All files created by apk add will not persist when the container exits. pip, though, is configured to install into your docker volume in /silo/userspace/lib and therefore will be available in all ansible calls later on.

Silo bundles don't use volumes. If you need bcrypt in a bundle you need to add the installation instructions to your Dockerfile like so:

RUN apk add --no-cache gcc \
                       libffi-dev \
                       python2-dev \
                       musl \
                       musl-dev \
                       musl-utils && \
    pip install bcrypt>=3.1.3 && \
    apk del --no-cache gcc \
                       libffi-dev \
                       python2-dev \
                       musl-dev

Does this help?


I'll leave this ticket open as this should get better documented.

@bdlamprecht
Copy link
Author

Similar to issue #54:

I've been able to solve this by rebuilding grpn/ansible-silo-base:3.0.0 and grpn/ansible-silo:3.0.0.
I'm still working through some issues, but when I'm ready, I will submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants