Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
e8db7ea
Use releases.yml in www.ruby-lang.org
mrkn Dec 18, 2019
72d2945
Support master-debug-nightly
mrkn May 14, 2020
bdd0cae
Use --build-arg
mrkn May 14, 2020
354a24c
Restrict the depth of git clone
mrkn May 14, 2020
6ab2de4
Fix CircleCI configuration
mrkn May 14, 2020
7b626d5
Merge pull request #12 from ruby/master-debug-nightly
mrkn May 14, 2020
cebac86
Update ruby versions
nurse May 21, 2020
226e58c
Build arm64 images
nurse May 21, 2020
ca709a8
Merge pull request #13 from nurse/arm64
mrkn May 23, 2020
36c5d8b
Update README.md
mrkn May 23, 2020
0111f23
Use git clone --shallow-since instead of --depth
mrkn Aug 27, 2020
0626e24
Stop copying config.log
mrkn Aug 27, 2020
6e36738
Add g++ in this image
mrkn Aug 27, 2020
389ea78
Add image build workflow
mrkn Sep 30, 2020
8f435a0
Add the docker login step
mrkn Oct 2, 2020
d23c45d
Add docker push step
mrkn Oct 2, 2020
5facbf6
Fix typo
mrkn Oct 2, 2020
f0860bf
Add the steps to push images to GitHub Package Registory
mrkn Oct 2, 2020
b265d42
Fix command line
mrkn Oct 2, 2020
1cd548d
Fix image names pushed to GitHub Package Registry
mrkn Oct 2, 2020
e5c61e8
Extract rename_images.rb
mrkn Oct 2, 2020
e1c65a8
Fix rename_images.rb
mrkn Oct 2, 2020
827ba86
Use ghcr.io and fix rename_images.rb
mrkn Oct 2, 2020
d1e1c68
Change the token
mrkn Oct 2, 2020
f22d740
Added the git repo provided by PPA. It make to use the latest version…
hsbt Oct 21, 2020
a44dadc
Merge pull request #17 from ruby/use-latest-version-of-git
mrkn Oct 21, 2020
1106269
Fixup https://github.com/ruby/ruby-docker-images/pull/17
hsbt Oct 21, 2020
031316c
Merge pull request #18 from ruby/fixup-17
mrkn Oct 21, 2020
471b83c
Use format instead of commands pipe lining
znz Nov 16, 2020
0fe6153
Add ubuntu_version_parameter to change the base image tag
mrkn Dec 8, 2020
e531205
Support to specify UBUNTU_VERSION in GitHub Actions
mrkn Dec 8, 2020
453a853
Support to specify ubuntu_version parameter on CircleCI
mrkn Dec 8, 2020
8e1fb96
Remove needless jobs on CircleCI
mrkn Dec 8, 2020
7684969
Fix CircleCI job definitions
mrkn Dec 8, 2020
6e44a4b
Merge pull request #20 from ruby/add_ubuntu_version_parameter
mrkn Dec 8, 2020
fc74e1b
Fix push destination in GitHub Container Registry
mrkn Dec 10, 2020
92274bb
Fix image name for ghcr.io
mrkn Dec 25, 2020
08be46b
delete apt cache every apt command
Feb 19, 2021
b58cb55
delete /tmp/www
Feb 22, 2021
0d8731c
Merge pull request #22 from pyama86/delete-tmp
hsbt Feb 22, 2021
ae3771e
Update .github/workflows/build.yml
hsbt Feb 22, 2021
dc9f914
Merge branch 'use-format' of https://github.com/znz/ruby-docker-image…
hsbt Feb 22, 2021
95c20a2
Merge branch 'znz-use-format'
hsbt Feb 22, 2021
fef580f
Merge pull request #21 from pyama86/delete-apt-cache
hsbt Feb 22, 2021
749610b
Add --all-tags option to push all images
k1LoW Mar 18, 2021
fcf46d1
Add alias tag without ubuntu codename for the latest version
mrkn Apr 5, 2021
c02afac
Merge pull request #25 from ruby/auto_alias_tag_for_latest_version
mrkn Apr 5, 2021
52973c1
Merge pull request #24 from k1LoW/push-all-images
mrkn Apr 5, 2021
88d7733
Update RUBYGEMS_VERSION
mrkn Apr 5, 2021
89d2fbe
Add name for build job
mrkn Apr 5, 2021
934c5c4
Fix Rakefile for master
mrkn Apr 19, 2021
337d3ed
Change workflow name
mrkn Nov 25, 2021
e17d765
Revert "Change workflow name"
mrkn Nov 25, 2021
b032746
Support Psych 4.0 which is bundled with Ruby 3.1
yahonda Jan 5, 2022
6796eb0
Stop updating rubygems
mrkn Feb 18, 2022
e5417d1
Merge pull request #28 from yahonda/psych4
hsbt Apr 7, 2022
fb2f29a
Use COPY instead of ADD
yano3 Aug 5, 2022
be99ef3
Enable to change the base image tag
yano3 Aug 6, 2022
9dc646c
Merge pull request #37 from yano3/fix-arm64-base-image
hsbt Aug 8, 2022
aa4f905
Merge pull request #36 from yano3/copy-instead-of-add
hsbt Aug 8, 2022
1cb461f
Add g++
yano3 Aug 13, 2022
e778569
Add git repository provided by PPA
yano3 Aug 13, 2022
f2d17e0
Merge pull request #38 from yano3/resolve-diffs-in-dockerfile
hsbt Aug 15, 2022
f1783a0
Remove QEMU base arm64 support
nurse Aug 22, 2022
ad9cff4
Add amd64/arm64 image
nurse Aug 22, 2022
ac699d3
Merge pull request #39 from nurse/multiarch-docker-image
mrkn Aug 22, 2022
9086345
With machine executor restore_cache doesn't work well
nurse Aug 22, 2022
84ff5aa
Add missing parameter: tag
nurse Aug 22, 2022
6618e73
push only specified docker image by tag (debug)
nurse Aug 22, 2022
3e86dcb
Pass tag parameter
nurse Aug 22, 2022
26a9ab1
Use latest docker CLI
nurse Aug 22, 2022
e4280d5
Receive ubuntu_version
nurse Aug 30, 2022
61a1591
fix executor reference
nurse Aug 31, 2022
6daab78
fix the default of executor
nurse Sep 4, 2022
984d98a
Use `docker` to compare
nurse Sep 6, 2022
abc2be2
CircleCI configuration logic seems not able to compare executor
nurse Sep 7, 2022
2da364e
Use tag parameter
nurse Sep 8, 2022
c4828a8
fix typo
nurse Sep 8, 2022
bb3285a
Add a comment and remove debug codes
nurse Sep 8, 2022
266cb90
Install rust and enable yjit
eileencodes Sep 20, 2022
d683322
Don't commit build dependencies
byroot Sep 21, 2022
b695afc
Merge pull request #1 from casperisfine/enable-yjit-in-nightly-images…
eileencodes Sep 21, 2022
3b5936b
Merge pull request #40 from eileencodes/enable-yjit-in-nightly-images
hsbt Sep 21, 2022
3cdc031
Use the same timezone as revision.h
k0kubun Nov 26, 2022
71465c9
Merge pull request #42 from k0kubun/utc
k0kubun Nov 28, 2022
f9afc98
Use jammy as the default
mrkn Dec 25, 2022
144308f
Merge pull request #43 from ruby/jammy
mrkn Dec 25, 2022
dfc1477
Use ./autogen.sh for building master
mrkn Dec 25, 2022
57be20d
Use choice type for UBUNTU_VERSION and ARCH parameters
mrkn Dec 26, 2022
523966a
Introduce LATEST parameter
mrkn Dec 26, 2022
77c2ee6
Introduce NOPUSH parameter
mrkn Dec 26, 2022
a86cfd7
Add parameter showing step
mrkn Dec 26, 2022
0edc9e1
Fix context expressions
mrkn Dec 26, 2022
1fa840a
Fix 'Check image' step
mrkn Dec 26, 2022
fc19ecb
Fix 'Check image' step again
mrkn Dec 26, 2022
67f8b8d
Revert "Fix 'Check image' step again"
mrkn Dec 26, 2022
e194780
Fix 'Check image' step again
mrkn Dec 26, 2022
e76a951
Fix NOPUSH condition
mrkn Dec 26, 2022
a7f3df0
Fix NOPUSH condition
mrkn Dec 26, 2022
4e810b2
Add Ubuntu pubkey
mrkn Dec 27, 2022
6204267
Install gnupg before apt-key command
mrkn Dec 27, 2022
0b3d8bc
Fix previous commit
mrkn Dec 27, 2022
e34faf8
Fix package name of gpg
mrkn Dec 27, 2022
4fa7cb5
Pass --security-opt and revert some prev commits
mrkn Dec 27, 2022
461d1de
Update CircleCI execute environment
mrkn Dec 27, 2022
04a6a6b
Fix yaml syntax error
mrkn Dec 27, 2022
d04edde
Remove --security-opt
mrkn Dec 27, 2022
918a438
Use rake task to handle docker manifest
mrkn Dec 27, 2022
3fb3acf
Use machine executor for deploy_multiarch
mrkn Dec 27, 2022
bdc645f
Use ruby:latest image for deploy_multiarch
mrkn Dec 27, 2022
b52defc
Fix docker manifest command line
mrkn Dec 27, 2022
3d88909
Put --tracde option for debugging
mrkn Dec 27, 2022
4a0c326
Test
mrkn Dec 27, 2022
464e5ab
Use amd64 executor again
mrkn Dec 27, 2022
3dbc0e3
Remove debug things
mrkn Dec 27, 2022
b654d00
Separate development image
mrkn Dec 27, 2022
d0ead22
Merge pull request #45 from ruby/multi-stage
mrkn Dec 27, 2022
bd9b9be
Use ./autogen.sh only if available and necessary
mrkn Dec 27, 2022
312f07c
Specify the default optflags if needed
mrkn Dec 27, 2022
0581cc1
Fix for required runtime libraries
mrkn Dec 28, 2022
f2d2f2a
Add curl, less, and lv in development image
mrkn Dec 28, 2022
e27e2b8
Make libruby.so and libruby.so.X.Y symlinks
mrkn Dec 28, 2022
440671f
Fix header file installation
mrkn Dec 28, 2022
4301a5a
Set LANG and DEBIAN_FRONTEND environment variables
mrkn Dec 30, 2022
6779ce0
Use --password-stdin on docker login
mrkn Dec 30, 2022
680ea02
Support to push to ghcr.io/ruby
mrkn Dec 30, 2022
b1307b7
Merge push_image_by_tag_ghcr and push_image_by_tag
mrkn Dec 30, 2022
b06fc05
Fix deploy_multiarch
mrkn Dec 30, 2022
d9755f2
Fix for nightly build
mrkn Jan 2, 2023
c898136
Update ubuntu version of nightly builds
mrkn Jan 2, 2023
dbab52a
Remove needless parameter
mrkn Jan 2, 2023
f7f0d91
Stop using scheduled workflow trigger
mrkn Jan 2, 2023
3cadce9
Ignore empty ruby_version
mrkn Jan 2, 2023
5901a5d
Fix condition of nightly workflow
mrkn Jan 2, 2023
4876a4d
Test nightly build
mrkn Jan 3, 2023
525d705
Use rake task to push image tags
mrkn Jan 3, 2023
73a05a3
Enable push nightly images
mrkn Jan 3, 2023
e25072c
Fix parameters of push_image command
mrkn Jan 3, 2023
424ef1b
Update README
mrkn Jan 3, 2023
7787772
Login registry before creating manifest
mrkn Feb 10, 2023
43f3e12
Fix docker:manifest:create and docker:manifest:push tasks
mrkn Feb 10, 2023
19af9d4
Use RUBY_SO_SUFFIX_MM instead of RUBY_VERSION_MM
hsbt Feb 13, 2023
dcc1d16
Fix missing `$`s
nobu Feb 13, 2023
7a04a26
Merge pull request #48 from ruby/fix-symlink
mrkn Feb 13, 2023
35307fb
Merge branch 'master' into fix-ruby-so-val
mrkn Feb 13, 2023
9d46388
Merge pull request #47 from ruby/fix-ruby-so-val
mrkn Feb 13, 2023
957f302
Drop --shallow-since
k0kubun Mar 15, 2023
797e958
Added dependabot update for GitHub Actions
hsbt Apr 3, 2023
c82cfba
Merge pull request #49 from ruby/added-automated-update-actions
hsbt Apr 3, 2023
d3a0d7e
Bump actions/checkout from 2 to 3
dependabot[bot] Apr 3, 2023
923d5ee
Merge pull request #50 from ruby/dependabot/github_actions/actions/ch…
hsbt Apr 3, 2023
75906df
platformをlinux/x86_64に指定する
aAnzai2017 Apr 11, 2023
8e6623f
with-jemallocでビルドする
aAnzai2017 Apr 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
411 changes: 293 additions & 118 deletions .circleci/config.yml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
88 changes: 88 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Build Docker image

on:
workflow_dispatch:
inputs:
RUBY_VERSION:
description: The version of Ruby to be build
required: true
default: master
UBUNTU_VERSION:
description: The version of Ubuntu as the base image
type: choice
options:
- jammy
- focal
- bionic
default: jammy
required: true
ARCH:
description: Which architecture amd64 or arm64 do you want to build? (The default is amd64)
type: choice
options:
- amd64
- arm64
default: amd64
required: true
LATEST:
description: Whether the latest tag should be created
type: boolean
default: false
required: true
NOPUSH:
description: Do not push the images (for debugging)
type: boolean
default: false
required: true

jobs:
build:
name: ${{ github.event.inputs.RUBY_VERSION }}-${{ github.event.inputs.UBUNTU_VERSION }}-${{ github.event.inputs.ARCH }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Show parameters
run: |
echo "RUBY_VERSION=${{ github.event.inputs.RUBY_VERSION }}"
echo "UBUNTU_VERSION=${{ github.event.inputs.UBUNTU_VERSION }}"
echo "ARCH=${{ github.event.inputs.ARCH }}"
echo "LATEST=${{ github.event.inputs.LATEST }}"
echo "NOPUSH=${{ github.event.inputs.NOPUSH }}"

- name: Build image
run: |
rake docker:build arch=${{ github.event.inputs.arch }} ruby_version=${{ github.event.inputs.RUBY_VERSION }} ubuntu_version=${{ github.event.inputs.UBUNTU_VERSION }}

- name: Check image
run: |
docker images

if [[ "${{ github.event.inputs.ARCH }}" != "amd64" ]]; then
ARCH_SUFFIX=-${{ github.event.inputs.ARCH }}
fi
docker run rubylang/ruby:${{ github.event.inputs.RUBY_VERSION }}-${{ github.event.inputs.UBUNTU_VERSION }}${ARCH_SUFFIX} ruby -v

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push images to DockerHub
run: docker push rubylang/ruby --all-tags
if: ${{ github.event.inputs.NOPUSH == 'false' }}

- name: Renaming images
run: |
docker images rubylang/ruby --format='docker tag {{.Repository}}:{{.Tag}} ghcr.io/ruby/ruby:{{.Tag}}' | sh -ex

- name: Login GitHub Container Registry
run: |
GHCR_TOKEN=${{ secrets.GHCR_TOKEN }}
echo $GHCR_TOKEN | docker login ghcr.io -u owner --password-stdin

- name: Push image to GitHub Container Registry
run: docker push ghcr.io/${{ github.repository_owner }}/ruby --all-tags
if: ${{ github.event.inputs.NOPUSH == 'false' }}
175 changes: 152 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
FROM ubuntu:bionic
ARG BASE_IMAGE_TAG
ARG RUBY_VERSION
ARG RUBY_SO_SUFFIX

### build ###
FROM --platform=linux/x86_64 ubuntu:$BASE_IMAGE_TAG AS build

ARG BASE_IMAGE_TAG
ARG RUBY_VERSION

ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive

ADD ruby_build_deps.txt /tmp/

RUN set -ex && \
\
apt-get update && \
\
if test "x$BASE_IMAGE_TAG" = "xbionic"; then \
apt-get install -y --no-install-recommends \
software-properties-common && \
apt-add-repository ppa:git-core/ppa; \
fi && \
\
apt-get install -y --no-install-recommends \
autoconf \
bison \
ca-certificates \
dpkg-dev \
gcc \
git \
g++ \
libffi-dev \
libgdbm-dev \
libgmp-dev \
Expand All @@ -19,22 +36,23 @@ RUN set -ex && \
libssl-dev \
libyaml-dev \
make \
autoconf \
bison \
git \
ruby \
rustc \
tzdata \
wget \
xz-utils \
zlib1g-dev \
$(cat /tmp/ruby_build_deps.txt)

RUN set -ex && \
useradd -ms /bin/bash ubuntu
libjemalloc-dev \
&& \
apt-get clean && \
rm -r /var/lib/apt/lists/*

ADD tmp/ruby /usr/src/ruby
ADD install_ruby.sh /tmp/
COPY tmp/ruby /usr/src/ruby
COPY install_ruby.sh /tmp/

ARG RUBY_VERSION=2.6.3
ENV RUBY_VERSION=$RUBY_VERSION
ENV RUBYGEMS_VERSION=3.0.3
ARG optflags
ARG debugflags
ARG cppflags

RUN set -ex && \
# skip installing gem documentation
Expand All @@ -44,15 +62,126 @@ RUN set -ex && \
echo 'update: --no-document'; \
} >> /usr/local/etc/gemrc && \
\
/tmp/install_ruby.sh && \
rm /tmp/install_ruby.sh && \
/tmp/install_ruby.sh


### ruby ###
FROM ubuntu:$BASE_IMAGE_TAG AS ruby

ARG BASE_IMAGE_TAG
ARG RUBY_VERSION
ARG RUBY_SO_SUFFIX

ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive

RUN set -ex && \
apt-get update && \
\
dpkg-query --show --showformat '${package}\n' \
| grep -P '^libreadline\d+$' \
| xargs apt-mark manual && \
if test "x$BASE_IMAGE_TAG" = "xbionic"; then \
apt-get install -y --no-install-recommends \
software-properties-common \
&& \
apt-add-repository ppa:git-core/ppa; \
fi && \
\
apt-get purge -y --auto-remove $(cat /tmp/ruby_build_deps.txt) && \
rm /tmp/ruby_build_deps.txt && \
apt-get install -y --no-install-recommends \
ca-certificates \
libffi-dev \
libgdbm-dev \
libgmp-dev \
libncurses5-dev \
libreadline-dev \
libssl-dev \
libyaml-dev \
tzdata \
zlib1g-dev \
&& \
dpkg-query --show --showformat '${package}\n' \
| grep -P '^(lib(ffi|gdbm|gmp|ncurses|readline|ssl|yaml)|zlib)' \
| grep -v -P -- '-dev$' \
| xargs apt-mark manual \
&& \
apt-get purge -y --auto-remove \
libffi-dev \
libgdbm-dev \
libgmp-dev \
libncurses5-dev \
libreadline-dev \
libssl-dev \
libyaml-dev \
zlib1g-dev \
&& \
\
apt-get clean && rm -r /var/lib/apt/lists/*

RUN set -ex && \
useradd -ms /bin/bash ubuntu

RUN mkdir -p /usr/local/etc

COPY --from=build \
/usr/local/etc/gemrc /usr/local/etc

COPY --from=build \
/usr/local/bin/bundle \
/usr/local/bin/bundler \
/usr/local/bin/erb \
/usr/local/bin/gem \
/usr/local/bin/irb \
/usr/local/bin/racc \
/usr/local/bin/rake \
/usr/local/bin/rdoc \
/usr/local/bin/ri \
/usr/local/bin/ruby \
/usr/local/bin/

COPY --from=build \
/usr/local/etc/gemrc \
/usr/local/etc/

COPY --from=build \
/usr/local/include \
/usr/local/include

COPY --from=build \
/usr/local/lib/libruby.so.${RUBY_SO_SUFFIX:-$RUBY_VERSION} \
/usr/local/lib/

RUN set -ex && \
RUBY_SO_SUFFIX_MM=$(echo ${RUBY_SO_SUFFIX:-$RUBY_VERSION} | sed -e 's/\.[^.]\+$//') && \
ln -sf libruby.so.${RUBY_SO_SUFFIX:-$RUBY_VERSION} /usr/local/lib/libruby.so.${RUBY_SO_SUFFIX_MM} && \
ln -sf libruby.so.${RUBY_SO_SUFFIX:-$RUBY_VERSION} /usr/local/lib/libruby.so

COPY --from=build \
/usr/local/lib/pkgconfig/ \
/usr/local/lib/pkgconfig/

COPY --from=build \
/usr/local/lib/ruby/ \
/usr/local/lib/ruby/

COPY --from=build \
/usr/local/share/man/man1/erb.1 \
/usr/local/share/man/man1/irb.1 \
/usr/local/share/man/man1/ri.1 \
/usr/local/share/man/man1/ruby.1 \
/usr/local/share/man/man1/


### development ###
FROM ruby AS development

RUN set -ex && \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
gdb \
git \
less \
lv \
wget \
&& \
apt-get clean && \
rm -r /var/lib/apt/lists/*
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ You can specify the specific revision in the master branch like:
rake docker:build ruby_version=master:ce798d08de
```

## Build and push for the specific ruby and ubuntu versions

Trigger CircleCI workflow with `ruby_version` and `ubuntu_version` pipeline parameters.
Nightly build workflow is triggered if the workflow triggered with `ruby_version` of `"nightly"`.
The nightly build workflow only builds images of linux/amd64 platform.

## Nightly build workflow

Nightly build workflow is performed by CircleCI's scheduled pipeline system.
The build is triggered at 16:00 UTC (01:00 JST) every night.

## Author

Kenta Murata
Expand Down
Loading