Skip to content

Commit

Permalink
Merge pull request #189 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 3.4.3
  • Loading branch information
andyone authored May 8, 2024
2 parents 30a3f06 + e76232d commit 947a954
Show file tree
Hide file tree
Showing 15 changed files with 426 additions and 200 deletions.
13 changes: 6 additions & 7 deletions .docker/jruby.docker
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

ARG REGISTRY="docker.io"

## BUILDER #####################################################################
## INSTALLER ###################################################################

FROM ${REGISTRY}/essentialkaos/oraclelinux:8 as installer
FROM ${REGISTRY}/essentialkaos/rbinstall:ol8 as installer

ARG RUBY_VERSION=9.3.9.0

RUN dnf -y -q install https://yum.kaos.st/kaos-repo-latest.el8.noarch.rpm && \
dnf -y -q install rbenv rbinstall jre11 && \
dnf -y -q module disable "*" && dnf clean all && rm -rf /var/cache/dnf /var/log/dnf.* && \
rbinstall jruby-${RUBY_VERSION} --no-progress
RUN rbinstall jruby-${RUBY_VERSION}

## FINAL IMAGE ################################################################

Expand All @@ -32,7 +29,9 @@ COPY --from=installer /usr/local/rbenv/versions/jruby-${RUBY_VERSION} \

RUN dnf -y -q install https://yum.kaos.st/kaos-repo-latest.el8.noarch.rpm && \
dnf -y -q install rbenv jre11 && \
dnf -y -q module disable "*" && dnf clean all && rm -rf /var/cache/dnf /var/log/dnf.* && \
dnf -y -q module disable "*" && \
dnf clean all && \
rm -rf /var/cache/dnf /var/log/dnf.* && \
source /etc/profile.d/rbenv.sh && \
rbenv global jruby-${RUBY_VERSION}

Expand Down
40 changes: 40 additions & 0 deletions .docker/ol8.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## REGISTRY CONFIGURATION ######################################################

ARG REGISTRY="docker.io"

## BUILDER #####################################################################

FROM ${REGISTRY}/essentialkaos/golang:ol8 as builder

WORKDIR /go/src/github.com/essentialkaos/rbinstall

COPY . .

RUN make deps && make all

## FINAL IMAGE ################################################################

FROM ${REGISTRY}/essentialkaos/oraclelinux:8

LABEL org.opencontainers.image.title="rbinstall-installer-ol8" \
org.opencontainers.image.description="RBInstall Installer Image (OL 8)" \
org.opencontainers.image.vendor="ESSENTIAL KAOS" \
org.opencontainers.image.authors="Anton Novojilov" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.url="https://kaos.sh/rbinstall" \
org.opencontainers.image.source="https://github.com/essentialkaos/rbinstall"

RUN dnf -y -q install https://yum.kaos.st/kaos-repo-latest.el8.noarch.rpm && \
dnf -y -q install rbenv libyaml jemalloc jre11 && \
dnf -y -q module disable "*" && \
dnf clean all && rm -rf /var/cache/dnf /var/log/dnf.* && \
mkdir -p /var/log/rbinstall && ln -sf /dev/null var/log/rbinstall/rbinstall.log

COPY --from=builder /go/src/github.com/essentialkaos/rbinstall/rbinstall /usr/bin/
COPY --from=builder /go/src/github.com/essentialkaos/rbinstall/common/rbinstall.knf /etc/

ENV PATH /usr/local/rbenv/shims:$PATH

CMD [ "rbinstall" ]

################################################################################
39 changes: 39 additions & 0 deletions .docker/ol9.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## REGISTRY CONFIGURATION ######################################################

ARG REGISTRY="docker.io"

## BUILDER #####################################################################

FROM ${REGISTRY}/essentialkaos/golang:ol9 as builder

WORKDIR /go/src/github.com/essentialkaos/rbinstall

COPY . .

RUN make deps && make all

## FINAL IMAGE ################################################################

FROM ${REGISTRY}/essentialkaos/oraclelinux:9

LABEL org.opencontainers.image.title="rbinstall-installer-ol9" \
org.opencontainers.image.description="RBInstall Installer Image (OL 9)" \
org.opencontainers.image.vendor="ESSENTIAL KAOS" \
org.opencontainers.image.authors="Anton Novojilov" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.url="https://kaos.sh/rbinstall" \
org.opencontainers.image.source="https://github.com/essentialkaos/rbinstall"

RUN dnf -y -q install https://yum.kaos.st/kaos-repo-latest.el9.noarch.rpm && \
dnf -y -q install rbenv rbinstall libyaml jemalloc jre11 && \
dnf clean all && rm -rf /var/cache/dnf /var/log/dnf.* && \
mkdir -p /var/log/rbinstall && ln -sf /dev/null var/log/rbinstall/rbinstall.log

COPY --from=builder /go/src/github.com/essentialkaos/rbinstall/rbinstall /usr/bin/
COPY --from=builder /go/src/github.com/essentialkaos/rbinstall/common/rbinstall.knf /etc/

ENV PATH /usr/local/rbenv/shims:$PATH

CMD [ "rbinstall" ]

################################################################################
13 changes: 6 additions & 7 deletions .docker/ruby-jemalloc.docker
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

ARG REGISTRY="docker.io"

## BUILDER #####################################################################
## INSTALLER ###################################################################

FROM ${REGISTRY}/essentialkaos/oraclelinux:8 as installer
FROM ${REGISTRY}/essentialkaos/rbinstall:ol8 as installer

ARG RUBY_VERSION=3.2.0
ARG WITH_STATIC=no

RUN dnf -y -q install https://yum.kaos.st/kaos-repo-latest.el8.noarch.rpm && \
dnf -y -q install rbenv rbinstall libyaml jemalloc && \
dnf -y -q module disable "*" && dnf clean all && rm -rf /var/cache/dnf /var/log/dnf.* && \
rbinstall ${RUBY_VERSION}-jemalloc --no-progress && \
RUN rbinstall ${RUBY_VERSION}-jemalloc && \
if [ "${WITH_STATIC}" != "no" ] ; then rm -f /usr/local/rbenv/versions/${RUBY_VERSION}/lib/libruby-static.a ; fi

## FINAL IMAGE ################################################################
Expand All @@ -36,7 +33,9 @@ COPY --from=installer /usr/local/rbenv/versions/${RUBY_VERSION}-jemalloc \
RUN dnf -y -q install https://yum.kaos.st/kaos-repo-latest.el8.noarch.rpm && \
dnf -y -q install rbenv libyaml jemalloc && \
if [ "${WITH_GCC}" != "no" ] ; then dnf -y -q install gcc ; fi && \
dnf -y -q module disable "*" && dnf clean all && rm -rf /var/cache/dnf /var/log/dnf.* && \
dnf -y -q module disable "*" && \
dnf clean all && \
rm -rf /var/cache/dnf /var/log/dnf.* && \
source /etc/profile.d/rbenv.sh && \
rbenv global ${RUBY_VERSION}-jemalloc

Expand Down
45 changes: 0 additions & 45 deletions .docker/ruby-railsexpress.docker

This file was deleted.

13 changes: 6 additions & 7 deletions .docker/ruby.docker
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

ARG REGISTRY="docker.io"

## BUILDER #####################################################################
## INSTALLER ###################################################################

FROM ${REGISTRY}/essentialkaos/oraclelinux:8 as installer
FROM ${REGISTRY}/essentialkaos/rbinstall:ol8 as installer

ARG RUBY_VERSION=3.2.0
ARG WITH_STATIC=no

RUN dnf -y -q install https://yum.kaos.st/kaos-repo-latest.el8.noarch.rpm && \
dnf -y -q install rbenv rbinstall libyaml && \
dnf -y -q module disable "*" && dnf clean all && rm -rf /var/cache/dnf /var/log/dnf.* && \
rbinstall ${RUBY_VERSION} --no-progress && \
RUN rbinstall ${RUBY_VERSION} && \
if [ "${WITH_STATIC}" != "no" ] ; then rm -f /usr/local/rbenv/versions/${RUBY_VERSION}/lib/libruby-static.a ; fi

## FINAL IMAGE ################################################################
Expand All @@ -36,7 +33,9 @@ COPY --from=installer /usr/local/rbenv/versions/${RUBY_VERSION} \
RUN dnf -y -q install https://yum.kaos.st/kaos-repo-latest.el8.noarch.rpm && \
dnf -y -q install rbenv libyaml && \
if [ "${WITH_GCC}" != "no" ] ; then dnf -y -q install gcc ; fi && \
dnf -y -q module disable "*" && dnf clean all && rm -rf /var/cache/dnf /var/log/dnf.* && \
dnf -y -q module disable "*" && \
dnf clean all && \
rm -rf /var/cache/dnf /var/log/dnf.* && \
source /etc/profile.d/rbenv.sh && \
rbenv global ${RUBY_VERSION}

Expand Down
58 changes: 57 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Check dockerfiles with Hadolint
uses: essentialkaos/hadolint-action@v1
with:
files: .docker/ruby.docker .docker/ruby-jemalloc.docker .docker/ruby-railsexpress.docker .docker/jruby.docker
files: .docker/ol8.docker .docker/ol9.docker .docker/ruby.docker .docker/ruby-jemalloc.docker .docker/jruby.docker

Typos:
name: Typos
Expand All @@ -98,3 +98,59 @@ jobs:
- name: Check spelling
continue-on-error: true
uses: crate-ci/typos@master

DockerBuild:
name: Docker Build Check
runs-on: ubuntu-latest

needs: [Hadolint]

env:
REGISTRY: ghcr.io

strategy:
matrix:
image: [ 'ol8', 'ol9' ]

steps:
- name: Check event type
run: |
if [[ "${{github.event_name}}" != "pull_request" ]] ; then
echo "::notice::Event type is not 'pull_request', all job actions will be skipped"
fi
# This step is a hack for needs+if issue with actions
# More info about issue: https://github.com/actions/runner/issues/491
- name: Checkout
uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request' }}

- name: Login to DockerHub
uses: docker/login-action@v3
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
if: ${{ github.event_name == 'pull_request' && env.DOCKERHUB_USERNAME != '' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

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

- name: Build Docker image
if: ${{ github.event_name == 'pull_request' }}
run: |
docker build --build-arg REGISTRY=${REGISTRY} -f .docker/${{matrix.image}}.docker -t ${{matrix.image}} .
- name: Show info about built Docker image
uses: essentialkaos/docker-info-action@v1
if: ${{ github.event_name == 'pull_request' }}
with:
image: ${{matrix.image}}
show-labels: true
Loading

0 comments on commit 947a954

Please sign in to comment.