envygeeks / jekyll-docker

⛴ Docker images, and CI builders for Jekyll.
ISC License
998 stars 282 forks source link

creation of custom image w/ jekyll-assets (and imagemagick apk) #122

Closed espinielli closed 7 years ago

espinielli commented 8 years ago

I like the jekyll/jekyll docker image idea of building a small image, so on top of it I am trying to build a development image to be used by all my teammates.

In a new directory, I created 3 files:

  1. a simple Dockerfile:

    FROM jekyll/jekyll:stable
    
    MAINTAINER E S <e.s@xyzzy.com>
    ENV REFRESHED_AT 2016-09-14
  2. a Gemfile:

    source 'https://rubygems.org'
    
    gem 'jekyll-assets'
  3. a .apk file (in order to install imagemagick):

    imagemagick

When I execute docker build --rm -t "espin/pru-jekyll:v1" . I successfully create the espin/pru-jekyll:v1 image. Unfortunatelly when I run it via

$ docker run -ti --rm -v "$PWD:/srv/jekyll" -p 4000:4000 espin/pru-jekyll:v1 sh

I see the jekyll-assets gem being installed (which I though would have been part of the image...) and cannot find any imagemagick cli too, i.e. convert.

Is this the right way to proceed? (And the right place where to ask?) Thank you in advance!

envygeeks commented 7 years ago

In the past we used to remove those dependencies after install, with the latest release we no longer do that, we keep those dependencies until exit. It should be released in a few minutes one my CI confirms it works.

espinielli commented 7 years ago

Sorry for late reply. Same setup as above still fails:

$ docker run -ti --rm -v "$PWD:/srv/jekyll" -p 4000:4000 espin/pru-jekyll:v1 sh
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies...
Installing public_suffix 2.0.5
Using colorator 1.1.0
Installing concurrent-ruby 1.0.5
Using forwardable-extended 2.6.0
Installing fastimage 2.1.0
Installing ffi 1.9.17 with native extensions

Errno::EACCES: Permission denied @ dir_s_mkdir - /usr/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.17
Installing sass 3.4.23
Installing rb-fsevent 0.9.8
Installing kramdown 1.13.2
Using liquid 3.0.6
Using mercenary 0.3.6
Using rouge 1.11.1
Using safe_yaml 1.0.4
Installing rack 1.6.5
Using bundler 1.12.5
Installing addressable 2.5.0
Installing extras 0.1.0
Using pathutil 0.14.0
An error occurred while installing ffi (1.9.17), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.17'` succeeds before bundling.
fetch http://mirror.envygeeks.io/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://mirror.envygeeks.io/alpine/edge/community/x86_64/APKINDEX.tar.gz
fetch http://mirror.envygeeks.io/alpine/edge/testing/x86_64/APKINDEX.tar.gz
(1/27) Upgrading musl (1.1.14-r11 -> 1.1.14-r14)
(2/27) Installing binutils-libs (2.26-r0)
(3/27) Installing binutils (2.26-r0)
(4/27) Installing isl (0.14.1-r0)
(5/27) Installing libgomp (5.3.0-r0)
(6/27) Installing libatomic (5.3.0-r0)
(7/27) Installing pkgconf (0.9.12-r0)
(8/27) Installing pkgconfig (0.25-r1)
(9/27) Installing mpfr3 (3.1.2-r0)
(10/27) Installing mpc1 (1.0.3-r0)
(11/27) Installing gcc (5.3.0-r0)
ERROR: Failed to create usr/libexec/gcc/x86_64-alpine-linux-musl/5.3.0/cc1obj: No space left on device
ERROR: gcc-5.3.0-r0: No space left on device
(12/27) Installing make (4.1-r1)
(13/27) Installing musl-dev (1.1.14-r14)
(14/27) Installing libc-dev (0.7-r0)
(15/27) Installing fortify-headers (0.8-r0)
(16/27) Installing g++ (5.3.0-r0)
ERROR: Failed to create usr/libexec/gcc/x86_64-alpine-linux-musl/5.3.0/cc1plus: No space left on device
ERROR: g++-5.3.0-r0: No space left on device
(17/27) Installing build-base (0.4-r1)
(18/27) Upgrading musl-utils (1.1.14-r11 -> 1.1.14-r14)
(19/27) Installing libffi-dev (3.2.1-r2)
(20/27) Installing zlib-dev (1.2.8-r2)
(21/27) Installing libxml2-dev (2.9.4-r0)
(22/27) Installing libxslt-dev (1.1.29-r0)
(23/27) Installing readline-dev (6.3.008-r4)
(24/27) Installing libgmpxx (6.1.0-r0)
(25/27) Installing gmp-dev (6.1.0-r0)
(26/27) Installing ruby-dev (2.3.1-r0)
(27/27) Installing yaml-dev (0.1.6-r1)
Executing busybox-1.24.2-r11.trigger
2 errors; 122 MiB in 68 packages