Skip to content

Commit

Permalink
feat(docker): User ruby:latest + add README (#55)
Browse files Browse the repository at this point in the history
* feat(docker): use ruby:latest

* feat(docs): add README

* chore(docs): add note re: semantic-release

* fix(fpm): add patch for apk

See also: jordansissel/fpm#1227

* chore(*): appease pre-commit
  • Loading branch information
curiositycasualty authored Dec 23, 2022
1 parent 1036c81 commit 24a0315
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 23 deletions.
42 changes: 19 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
FROM ubuntu:jammy@sha256:27cb6e6ccef575a4698b66f5de06c7ecd61589132d5a91d098f7f3f9285415a9
FROM ruby:latest@sha256:6a8cd3ae45904f72fad21739df5b7eed642254a1a44e600ddeeba1322f6af310
RUN echo "disabled"

FROM ubuntu:jammy
FROM ruby:latest

ARG FPM_VERSION=1.15.0
ENV FPM_VERSION="${FPM_VERSION}"

ENV DEBIAN_FRONTEND noninteractive

RUN set -x \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
ruby \
ruby-dev \
gcc \
build-essential \
libffi-dev \
make \
ca-certificates \
libffi-dev \
ruby-ffi \
rpm \
git \
gpg \
gpg-agent \
expect \
&& apt-get install --reinstall -y bash \
&& gem install fpm \
&& mkdir /src/ \
SHELL ["/bin/bash", "-e", "-x", "-c"]

COPY patches/fpm-apk-archive-header.patch /tmp/fpm.patch

RUN if [[ "$FPM_VERSION" == 'latest' ]]; then \
gem install --no-document fpm; \
else \
gem install --no-document fpm -v "$FPM_VERSION"; \
fi

# https://github.com/jordansissel/fpm/issues/1227
RUN cd $(gem env gemhome)/gems/fpm-* \
&& patch -p 0 -ruN < /tmp/fpm.patch \
&& mkdir -pv /src/ \
&& fpm --version

WORKDIR /src/
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# docker-fpm

This repository houses a `Dockerfile` and `docker-bake.hcl` which build a container around [fpm](https://fpm.readthedocs.io/en/latest/), the package manager used by [kong-build-tools](https://github.com/Kong/kong-build-tools/blob/d1c1b71e238b715b2a3ff551ab31628426a228df/dockerfiles/Dockerfile.package#L8).

## Contributing

Changes to this repo cause its Dockerfile to be automatically built and released by Github Actions when the commits for said changes confirm to [Semantic Release](https://semantic-release.gitbook.io/semantic-release/) conventions.
12 changes: 12 additions & 0 deletions patches/fpm-apk-archive-header.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --color -Naur lib/fpm/package/apk.rb.orig lib/fpm/package/apk.rb
--- lib.orig/fpm/package/apk.rb 2022-12-23 14:03:55.583865965 -0800
+++ lib/fpm/package/apk.rb 2022-12-23 14:06:56.040703096 -0800
@@ -252,7 +252,7 @@

# directories have a magic string inserted into their name
full_record_path = extension_header[TAR_NAME_OFFSET_START..TAR_NAME_OFFSET_END].delete("\0")
- full_record_path = add_paxstring(full_record_path)
+ # full_record_path = add_paxstring(full_record_path)

# hash data contents with sha1, if there is any content.
if(typeflag == '5')

0 comments on commit 24a0315

Please sign in to comment.