Skip to content

Commit

Permalink
Fix Node install & adopt fork GHA and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
arBmind committed Oct 2, 2024
1 parent d51b0d3 commit c89e95c
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 134 deletions.
174 changes: 45 additions & 129 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,145 +7,61 @@ on:

jobs:
build:
name: alpinelab/ruby-dev:${{ matrix.ruby }}${{ matrix.variant }}
runs-on: ubuntu-latest
name: ruby-dev:${{ matrix.ruby }}${{ matrix.variant }}
strategy:
fail-fast: false
matrix:
ruby:
- 3.3.1
- 3.3.0
- 3.2.4
- 3.2.3
- 3.3.5
- 3.3.4
- 3.2.5
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.7.8
- 2.7.7
- 2.7.6
- 2.7.5
- 2.7.4
- 2.7.3
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.10
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.9
- 2.5.8
- 2.5.7
- 2.5.6
- 2.5.5
- 2.5.4
- 2.5.3
# Ruby 2.5.2 never existed: it was mis-packaged and 2.5.3 was released immediately to fix it
- 2.5.1
- 2.5.0
- 2.4.10
- 2.4.9
- 2.4.8
- 2.4.7
- 2.4.6
- 2.4.5
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.8
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
variant: ["", "-alpine"]
exclude: []
include: []
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

exclude:
# the following needs an explicit Alpine version, so we exlude them here and re-include them with explicit version below
- { ruby: 2.4.3, variant: "-alpine" }
- { ruby: 2.4.2, variant: "-alpine" }
- { ruby: 2.4.1, variant: "-alpine"}
# the following do not have an Alpine variant because Yarn is unavailable on their base Alpine version (< 3.6)
- { ruby: 2.4.0, variant: "-alpine" }
- { ruby: 2.3.6, variant: "-alpine" }
- { ruby: 2.3.5, variant: "-alpine" }
- { ruby: 2.3.4, variant: "-alpine" }
- { ruby: 2.3.3, variant: "-alpine" }
- { ruby: 2.3.2, variant: "-alpine" }
- { ruby: 2.3.1, variant: "-alpine" }
- { ruby: 2.3.0, variant: "-alpine" }
- uses: docker/setup-buildx-action@v3

include:
- ruby: 2.4.3
variant: "-alpine3.7"
- ruby: 2.4.2
variant: "-alpine3.7"
- ruby: 2.4.1
variant: "-alpine3.6"
steps:
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/build-push-action@v2
with:
push: true
build-args: |
BASE_IMAGE_TAG=${{ matrix.ruby }}${{ matrix.variant }}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
visibility: public
build-args: |
BASE_IMAGE_TAG=${{ matrix.ruby }}${{ matrix.variant }}
${{ startsWith(matrix.ruby, '2.5') && 'RUBYGEMS_VERSION_ARG=3.3.26' || '' }}
${{ startsWith(matrix.ruby, '2.4') && 'RUBYGEMS_VERSION_ARG=3.3.26' || '' }}
${{ startsWith(matrix.ruby, '2.3') && 'RUBYGEMS_VERSION_ARG=3.3.26' || '' }}
tags: |
hnhs/ruby-dev:${{ matrix.ruby }}${{ matrix.variant }}
ghcr.io/hicknhack-software/ruby-dev:${{ matrix.ruby }}${{ matrix.variant }}
${{ startsWith(matrix.ruby, '2.5') && 'BUNDLER_VERSION_ARG=2.3.26' || '' }}
${{ startsWith(matrix.ruby, '2.4') && 'BUNDLER_VERSION_ARG=2.3.26' || '' }}
${{ startsWith(matrix.ruby, '2.3') && 'BUNDLER_VERSION_ARG=2.3.26' || '' }}
${{ matrix.ruby == '3.3.5' && format('hnhs/ruby-dev:latest{0}', matrix.variant) || '' }}
${{ matrix.ruby == '3.3.5' && format('ghcr.io/hicknhack-software/ruby-dev:latest{0}', matrix.variant) || '' }}
tags: |
alpinelab/ruby-dev:${{ matrix.ruby }}${{ matrix.variant }}
${{ matrix.ruby == '3.3.5' && format('hnhs/ruby-dev:3{0}', matrix.variant) || '' }}
${{ matrix.ruby == '3.3.5' && format('ghcr.io/hicknhack-software/ruby-dev:3{0}', matrix.variant) || '' }}
${{ matrix.ruby == '3.3.1' && format('alpinelab/ruby-dev:latest{0}', matrix.variant) || '' }}
${{ matrix.ruby == '3.3.1' && format('alpinelab/ruby-dev:3{0}', matrix.variant) || '' }}
${{ matrix.ruby == '3.3.1' && format('alpinelab/ruby-dev:3.3{0}', matrix.variant) || '' }}
${{ matrix.ruby == '3.2.4' && format('alpinelab/ruby-dev:3.2{0}', matrix.variant) || '' }}
${{ matrix.ruby == '3.1.5' && format('alpinelab/ruby-dev:3.1{0}', matrix.variant) || '' }}
${{ matrix.ruby == '3.0.7' && format('alpinelab/ruby-dev:3.0{0}', matrix.variant) || '' }}
${{ matrix.ruby == '2.7.8' && format('alpinelab/ruby-dev:2.7{0}', matrix.variant) || '' }}
${{ matrix.ruby == '2.7.8' && format('alpinelab/ruby-dev:2{0}', matrix.variant) || '' }}
${{ matrix.ruby == '2.6.10' && format('alpinelab/ruby-dev:2.6{0}', matrix.variant) || '' }}
${{ matrix.ruby == '2.5.9' && format('alpinelab/ruby-dev:2.5{0}', matrix.variant) || '' }}
${{ matrix.ruby == '2.4.10' && format('alpinelab/ruby-dev:2.4{0}', matrix.variant) || '' }}
${{ matrix.ruby == '2.3.8' && format('alpinelab/ruby-dev:2.3{0}', matrix.variant) || '' }}
${{ matrix.ruby == '3.3.5' && format('hnhs/ruby-dev:3.3{0}', matrix.variant) || '' }}
${{ matrix.ruby == '3.3.5' && format('ghcr.io/hicknhack-software/ruby-dev:3.3{0}', matrix.variant) || '' }}
${{ (matrix.ruby == '2.4.3' && matrix.variant == '-alpine3.7') && 'alpinelab/ruby-dev:2.4.3-alpine' || '' }}
${{ (matrix.ruby == '2.4.2' && matrix.variant == '-alpine3.7') && 'alpinelab/ruby-dev:2.4.2-alpine' || '' }}
${{ (matrix.ruby == '2.4.3' && matrix.variant == '-alpine3.6') && 'alpinelab/ruby-dev:2.4.1-alpine' || '' }}
${{ matrix.ruby == '3.2.5' && format('ghcr.io/hicknhack-software/ruby-dev:3.2{0}', matrix.variant) || '' }}
${{ matrix.ruby == '3.2.5' && format('hnhs/ruby-dev:3.2{0}', matrix.variant) || '' }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha
cache-to: type=gha,mode=max
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ RUN set -eux; \
jq \
nano \
nodejs \
$([ "${debianReleaseCodename}" = "bookworm" ] && echo "npm") \
postgresql-client \
vim \
; \
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# `alpinelab/ruby-dev` [![Docker Stars](https://img.shields.io/docker/stars/alpinelab/ruby-dev?style=flat-square)](https://hub.docker.com/r/alpinelab/ruby-dev/) [![Docker Pulls](https://img.shields.io/docker/pulls/alpinelab/ruby-dev.svg?style=flat-square)](https://hub.docker.com/r/alpinelab/ruby-dev/) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/alpinelab/docker-ruby-dev/docker-build.yml?style=flat-square)](https://github.com/alpinelab/docker-ruby-dev/actions/workflows/docker-build.yml)
# `hnhs/ruby-dev`

A fork from `alpine-labs/ruby-dev`.

The main goal of this project is to have a single Docker image to develop all your Ruby projects, with **all dependencies contained inside Docker** (like gems, NPM packages or even Ruby itself, that won't pollute your host environment) and without anything specific to the project in the Docker image (the **codebase is mounted directly from the host filesystem into the container**, thus you'll never have to build the image when you add a gem or change some code).

Expand Down Expand Up @@ -33,7 +35,7 @@ volumes:
config: { driver: local }
services:
app:
image: alpinelab/ruby-dev
image: hnhs/ruby-dev
ports: ["5000:5000"]
volumes:
- .:/app
Expand All @@ -42,7 +44,7 @@ services:
- config:/config
```

> 💡 Feel free to use `alpinelab/ruby-dev:<ruby-version>`: we support [multiple Ruby versions](.github/workflows/docker-build.yml) [as Docker tags](https://hub.docker.com/r/alpinelab/ruby-dev/tags/)
> 💡 Feel free to use `hnhs/ruby-dev:<ruby-version>`: we support [multiple Ruby versions](.github/workflows/docker-build.yml) [as Docker tags](https://hub.docker.com/r/hnhs/ruby-dev/tags/)
> and Alpine Linux variants (append `-alpine` to image tag).

<details>
Expand Down Expand Up @@ -150,9 +152,11 @@ The following Ruby versions are not maintained anymore:

* Ruby 2.2 ([EOL](https://www.ruby-lang.org/en/news/2018/06/20/support-of-ruby-2-2-has-ended/)'d)

⚠️ Note: This fork only contains the latest Ruby versions to minimize the effort. Feel free to open an issue if you need a different Ruby version.

## Contributing

Contributions are indeed warmly welcome as [pull requests](https://github.com/alpinelab/docker-ruby-dev/pulls), or [issues](https://github.com/alpinelab/docker-ruby-dev/issues) ❤️
Contributions are indeed warmly welcome as [pull requests](https://github.com/hicknhack-software/docker-ruby-dev/pulls), or [issues](https://github.com/hicknhack-software/docker-ruby-dev/issues) ❤️

## License

Expand Down

0 comments on commit c89e95c

Please sign in to comment.