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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-arch support #245

Closed
1 task done
flipacholas opened this issue Jan 24, 2019 · 7 comments · May be fixed by #356
Closed
1 task done

Add multi-arch support #245

flipacholas opened this issue Jan 24, 2019 · 7 comments · May be fixed by #356

Comments

@flipacholas
Copy link

flipacholas commented Jan 24, 2019

  • This feature is not on the latest version

Request

I think a great addition would be to add support for more architectures than x86_64.
According to here, it would only need to add a manifest list with all the supported architectures and since alpine/ruby already support a few maybe the exact number could be included here?

Examples

armhf, ppc, sparc, etc.

@envygeeks
Copy link
Owner

I am definitely interested in ARM, no doubt. I don't know how much the other platforms are used, but I'm not necessarily against them. I'll have to look into that more unless you can chime in and fill me in, can those be built on Travis-CI still or do they have to be built in parity?

@flipacholas
Copy link
Author

flipacholas commented Jan 25, 2019

It seems that the instructions I've referenced use Docker Hub to build the images, I'll fork your repo and see if I can add the manifest list without changing your Travis scripts.

@flipacholas
Copy link
Author

flipacholas commented Jan 30, 2019

It's going to be more complicated than that I'm afraid. From what I see, since this jekyll image and its variants are being build from Travis (a x86 machine) and the result will always be a x86 image. To build for ARM and other architectures we need the host machine to be from that architecture (since the base-image to be used has to be from that arch. as well).

The solution on x86-only hosts is to inject the qemu-user-static interpreter on non-x86 dockerfiles as described here (one of many examples btw) and docker's build will take care of the rest.

@Blafy
Copy link

Blafy commented Jul 5, 2019

Hi !

Setting up multi-arch Docker support on a single host is a pain in the ass with Travis CI (Drone.io is easier to use for native builds for example), but I managed to build the Docker version of Jekyll with armv6 support.
Using the arm32v6/ruby images to start with, it is just a couple of changes related to injecting qemu-user-static :

Blafy/jekyll-docker-arm@f8dd42e
https://travis-ci.org/Blafy/jekyll-docker-arm/builds
https://hub.docker.com/r/blafy/jekyll

Here is a demonstration with a Raspberry Pi first generation (armv6 alias armhf)

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.14.98+ #1200 Tue Feb 12 20:11:02 GMT 2019 armv6l GNU/Linux

pi@raspberrypi:~ $ docker run blafy/jekyll:stable
ruby 2.6.3p62 (2019-04-16 revision 67580) [arm-linux-musleabihf]
jekyll 3.8.5 -- Jekyll is a blog-aware, static site generator in Ruby

Usage:

  jekyll <subcommand> [options]

Options:
        -s, --source [DIR]  Source directory (defaults to ./)
        -d, --destination [DIR]  Destination directory (defaults to ./_site)
            --safe         Safe mode (defaults to false)
        -p, --plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]  Plugins directory (defaults to ./_plugins)
            --layouts DIR  Layouts directory (defaults to ./_layouts)
            --profile      Generate a Liquid rendering profile
        -h, --help         Show this message
        -v, --version      Print the name and version
        -t, --trace        Show the full backtrace when an error occurs

Subcommands:
  docs
  import
  build, b              Build your site
  clean                 Clean the site (removes site output and metadata file) without building.
  doctor, hyde          Search site and print specific deprecation warnings
  help                  Show the help message, optionally for a given subcommand.
  new                   Creates a new Jekyll site scaffold in PATH
  new-theme             Creates a new Jekyll theme scaffold
  serve, server, s      Serve your site locally

I need to clean a few things, try to add the aarch64 (no need for armv7, as it supports v6 binaries) and then I can submit a PR 🙂

@envygeeks How do you want to handle the additionnal images in the repos ? By adding -arm a the end of the tag ?

@envygeeks
Copy link
Owner

envygeeks commented Jul 5, 2019

@Blafy tonight I'll set it up so that our images use a configuration tag for the image, so we can split them off into repos with symlinked build files and a configuration that changes the base image each one uses. That way when they get built each one can use it's own base!

@Blafy
Copy link

Blafy commented Jul 7, 2019

Some news :

  • I managed to build an aarch64 image with success (tested on a ARM-64 server at Scaleway).

  • There is a simple way to link several architectures to one tag, using the experimental manifest feature : https://medium.com/@mauridb/docker-multi-architecture-images-365a44c26be6. This is great because it will prevent any breaking change for people pulling the jekyll/latest, as it will automatically select the right arch.
    .
    Screenshot_20190707_235506

@envygeeks
Copy link
Owner

Closing this since it's a dangling issue, if somebody plans to work with me on this I'll reopen it!

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

Successfully merging a pull request may close this issue.

3 participants