Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ jobs:
matrix:
image:
- grunt
- rails
- jq
- goaccess
steps:
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/rails-docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Rails Docker Images

on:
push:
branches: [master]
paths:
- "rails/**/Dockerfile"
- ".github/workflows/rails-docker-build.yml"
pull_request:
branches: [master]
paths:
- "rails/**/Dockerfile"
- ".github/workflows/rails-docker-build.yml"
workflow_dispatch:

jobs:
build-rails:
name: Build Rails Images
runs-on: ubuntu-latest
strategy:
matrix:
include:
- rails-version: '6' # Rails 6
is-latest: false
- rails-version: '7' # Rails 7
is-latest: false
- rails-version: '8' # Rails 8
is-latest: true
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: voxxit/rails
tags: |
type=raw,value=${{ matrix.rails-version }}
type=raw,value=latest,enable=${{ matrix.is-latest == true }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./rails/${{ matrix.rails-version }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
6 changes: 3 additions & 3 deletions apt-mirror/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ ENV SLEEP_SECS 3600

VOLUME ["${BASE_PATH}"]

COPY --from=src ./resources/apt/mirror.list.template /etc/apt/
COPY --from=src ./resources/apt/post-mirror.sh ${VAR_PATH}/
COPY --from=src ./resources/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./resources/apt/mirror.list.template /etc/apt/
COPY ./resources/apt/post-mirror.sh ${VAR_PATH}/
COPY ./resources/docker-entrypoint.sh /docker-entrypoint.sh

ENTRYPOINT ["/docker-entrypoint.sh"]
4 changes: 2 additions & 2 deletions bind/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM alpine:3.21

RUN apk add --no-cache bind bind-doc bind-tools

COPY --from=src etc/bind/ /etc/bind/
COPY --from=src entrypoint.sh /sbin/entrypoint.sh
COPY etc/bind/ /etc/bind/
COPY entrypoint.sh /sbin/entrypoint.sh

EXPOSE 53/tcp 53/udp

Expand Down
6 changes: 3 additions & 3 deletions icecast/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ RUN addgroup -g 1000 icecast \
&& install -d -o icecast -g icecast /etc/icecast \
&& chown -R icecast:icecast /usr/share/icecast

COPY --from=src etc/mime.types /etc/
COPY etc/mime.types /etc/

USER icecast:icecast

COPY --from=src etc/icecast.xml /etc/icecast/
COPY --from=src docker-entrypoint.sh /
COPY etc/icecast.xml /etc/icecast/
COPY docker-entrypoint.sh /

CMD [ "/docker-entrypoint.sh" ]
4 changes: 2 additions & 2 deletions liquidsoap/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LABEL org.opencontainers.image.authors="[email protected]"

ENV LIQUIDSOAP_VERSION="2.2.0"

COPY --from=src install.sh /tmp/install.sh
COPY install.sh /tmp/install.sh

RUN chmod +x /tmp/install.sh \
&& /tmp/install.sh "${LIQUIDSOAP_VERSION}" \
Expand All @@ -28,7 +28,7 @@ VOLUME [ "/media", "/var/log/liquidsoap" ]

EXPOSE 10000/tcp

COPY --chown=1001:1001 --from=src start-liquidsoap.sh /usr/bin/start-liquidsoap.sh
COPY --chown=1001:1001 start-liquidsoap.sh /usr/bin/start-liquidsoap.sh
USER 1001:1001

ENTRYPOINT [ "/usr/bin/start-liquidsoap.sh" ]
2 changes: 1 addition & 1 deletion memcached/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LABEL org.opencontainers.image.authors="[email protected]"

ENV HOME /root

COPY --from=src start /start
COPY start /start

RUN apt-get update && \
apt-get install -y memcached sasl2-bin pwgen && \
Expand Down
2 changes: 1 addition & 1 deletion nginx-geoip2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:jammy

COPY --from=src . /
COPY . /

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
Expand Down
19 changes: 10 additions & 9 deletions nginx-http2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@ LABEL org.opencontainers.image.authors="[email protected]"

EXPOSE 80/tcp 443/tcp

ENV NGINX_VERSION 1.15.12
ENV NGINX_VERSION 1.26.3

RUN apk add --no-cache openssl-dev pcre-dev zlib-dev build-base \
RUN apk add --no-cache openssl-dev~=3.3 pcre-dev zlib-dev build-base \
&& wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz \
&& tar -xzvf nginx-${NGINX_VERSION}.tar.gz \
&& cd nginx-${NGINX_VERSION} \
&& ./configure \
--with-http_v2_module \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-threads \
--with-ipv6 \
--with-http_v2_module \
--with-http_ssl_module \
--with-openssl-opt=enable-tls1_3 \
--with-http_realip_module \
--with-http_stub_status_module \
--with-threads \
--with-ipv6 \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& apk del build-base \
&& rm -rf /nginx-*

COPY --from=src nginx.conf /usr/local/nginx/conf/nginx.conf
COPY nginx.conf /usr/local/nginx/conf/nginx.conf

VOLUME [ "/usr/local/nginx/logs", "/usr/local/nginx/html", "/usr/local/nginx/conf" ]

Expand Down
2 changes: 1 addition & 1 deletion nginx-rtmp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN apt-get update \
RUN ln -sf /dev/stdout /usr/local/nginx/logs/access.log \
&& ln -sf /dev/stderr /usr/local/nginx/logs/error.log

COPY --from=src conf/nginx.conf /usr/local/nginx/conf/
COPY conf/nginx.conf /usr/local/nginx/conf/

EXPOSE 80/tcp 1935/tcp

Expand Down
2 changes: 1 addition & 1 deletion nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ VOLUME [ "/etc/nginx" ]

EXPOSE 80/tcp 443/tcp

COPY --from=src nginx.conf /etc/nginx/nginx.conf
COPY nginx.conf /etc/nginx/nginx.conf

ENTRYPOINT ["nginx"]
CMD ["-c", "/etc/nginx/nginx.conf"]
2 changes: 1 addition & 1 deletion pg/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ RUN apt-get update && \

VOLUME ["/var/lib/postgresql"]

COPY --from=src start /start
COPY start /start

CMD ["/start"]
2 changes: 1 addition & 1 deletion powerdns/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN apt-get update \
&& apt-get -y install --no-install-recommends pdns-server pdns-backend-mysql dnsutils \
&& rm -rf /var/lib/apt/lists/*

COPY --from=src *.conf /etc/powerdns/pdns.d/
COPY *.conf /etc/powerdns/pdns.d/

EXPOSE 53/tcp 53/udp 8081/tcp

Expand Down
28 changes: 28 additions & 0 deletions rails/6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM alpine:3.16

RUN apk add --no-cache \
bash make nodejs gcc g++ libc-dev git ruby libxml2-dev libxslt-dev \
libffi-dev yaml-dev openssl-dev zlib-dev readline-dev linux-headers \
&& mkdir -p /usr/src/app \
&& git clone https://github.com/postmodern/ruby-install /usr/src/ruby-install \
&& cd /usr/src/ruby-install \
&& make install \
&& ruby-install --system ruby 3.0.6 -- --disable-install-rdoc \
--with-openssl-dir=/usr \
&& gem install 'bundler:2.2.33' 'rails:6.1.7.10' \
&& bundle config --global build.nokogiri --use-system-libraries \
&& apk del ruby \
&& rm -rf /usr/src/*

WORKDIR /usr/src/app

ONBUILD COPY ./Gemfile /usr/src/app/
ONBUILD COPY ./Gemfile.lock /usr/src/app/

ONBUILD RUN bundle install --system

ONBUILD COPY . /usr/src/app

EXPOSE 3000/tcp

CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
28 changes: 28 additions & 0 deletions rails/7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM alpine:3.21

RUN apk add --no-cache \
bash make nodejs gcc g++ libc-dev git ruby libxml2-dev libxslt-dev \
libffi-dev yaml-dev openssl-dev zlib-dev readline-dev linux-headers \
&& mkdir -p /usr/src/app \
&& git clone https://github.com/postmodern/ruby-install /usr/src/ruby-install \
&& cd /usr/src/ruby-install \
&& make install \
&& ruby-install --system ruby 3.3.0 -- --disable-install-rdoc \
--with-openssl-dir=/usr \
&& gem install 'bundler:2.5.6' 'rails:7.2.2.1' \
&& bundle config --global build.nokogiri --use-system-libraries \
&& apk del ruby \
&& rm -rf /usr/src/*

WORKDIR /usr/src/app

ONBUILD COPY ./Gemfile /usr/src/app/
ONBUILD COPY ./Gemfile.lock /usr/src/app/

ONBUILD RUN bundle install --system

ONBUILD COPY . /usr/src/app

EXPOSE 3000/tcp

CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
12 changes: 6 additions & 6 deletions rails/Dockerfile → rails/8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM alpine:3.21

RUN apk add --no-cache \
bash make nodejs gcc libc-dev git ruby libxml2-dev libxslt-dev \
libffi-dev yaml-dev openssl-dev zlib-dev readline-dev \
bash make nodejs gcc g++ libc-dev git ruby libxml2-dev libxslt-dev \
libffi-dev yaml-dev openssl-dev zlib-dev readline-dev linux-headers \
&& mkdir -p /usr/src/app \
&& git clone https://github.com/postmodern/ruby-install /usr/src/ruby-install \
&& cd /usr/src/ruby-install \
&& make install \
&& ruby-install --system ruby 2.2.0-rc1 -- --disable-install-rdoc \
&& gem install bundler --no-ri --no-rdoc \
&& ruby-install --system ruby 3.3.0 -- --disable-install-rdoc \
--with-openssl-dir=/usr \
&& gem install 'bundler:2.5.6' 'rails:8.0.2' \
&& bundle config --global build.nokogiri --use-system-libraries \
&& apk del ruby \
&& rm -rf /usr/src/*
Expand All @@ -24,5 +25,4 @@ ONBUILD COPY . /usr/src/app

EXPOSE 3000/tcp

# replace in your Dockerfile with another ruby server, etc.
CMD bundle exec rails server
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
2 changes: 1 addition & 1 deletion rsyslog/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ VOLUME [ "/var/log", "/etc/rsyslog.d" ]

# for some reason, the apk comes built with a v5
# config file. using this one for v8:
COPY --from=src ./etc/rsyslog.conf /etc/rsyslog.conf
COPY ./etc/rsyslog.conf /etc/rsyslog.conf

ENTRYPOINT [ "rsyslogd", "-n" ]
4 changes: 2 additions & 2 deletions swarm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM scratch

LABEL org.opencontainers.image.authors="[email protected]"

COPY --from=src swarm_linux_amd64 /bin/swarm
COPY --from=src ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY swarm_linux_amd64 /bin/swarm
COPY ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

EXPOSE 2375

Expand Down