Skip to content

Commit

Permalink
[ruby] Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
hason committed Jul 24, 2019
1 parent 0d986c1 commit 13ad9c9
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 38 deletions.
1 change: 0 additions & 1 deletion .hub/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions .hub/hooks/post_checkout

This file was deleted.

24 changes: 0 additions & 24 deletions 2.4/Dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion 2.4/rootfs

This file was deleted.

1 change: 0 additions & 1 deletion 2.5/rootfs

This file was deleted.

12 changes: 8 additions & 4 deletions 2.5/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
FROM minidocks/base:3.8
ARG version=2.5

FROM minidocks/base:3.7 AS v2.4

FROM minidocks/base AS v2.5

FROM v${version}
LABEL maintainer="Martin Hasoň <[email protected]>"

# install things globally, for great justice and don't create ".bundle" in all our apps
Expand All @@ -15,10 +21,8 @@ RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" && mkdir -p "$BUNDLE_CACHE_PAT

COPY rootfs /

RUN apk --update add 'ruby<2.6' ruby-irb \
RUN apk --update add ruby ruby-irb \
&& gem install bundler \
&& clean

CMD [ "irb" ]

# see https://github.com/docker-library/ruby/blob/master/2.5/alpine3.8/Dockerfile
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Tags
----

Tag | Size
---------- | ----
--- | ----
latest | [![](https://images.microbadger.com/badges/image/minidocks/ruby.svg)](https://microbadger.com/images/minidocks/ruby)
2.5 | [![](https://images.microbadger.com/badges/image/minidocks/ruby:2.5.svg)](https://microbadger.com/images/minidocks/ruby:2.5)
2.4 | [![](https://images.microbadger.com/badges/image/minidocks/ruby:2.4.svg)](https://microbadger.com/images/minidocks/ruby:2.4)
Expand Down
19 changes: 19 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
set -e

image="${namespace:-minidocks}/ruby"
versions="
2.4;2.4
2.5;2.5
latest;2.5
"

build() {
docker build $docker_opts --build-arg version="$2" -t "$image:$1" "$(dirname $0)"
}

case "$1" in
--versions) echo "$versions" | awk 'NF' | cut -d';' -f1;;
'') echo "$versions" | grep -v "^$" | while read -r version; do IFS=';'; build $version; done;;
*) args="$(echo "$versions" | grep -E "^$1(;|$)")"; if [ -n "$args" ]; then IFS=';'; build $args; else echo "Version $1 does not exist." >/dev/stderr; exit 1; fi
esac
1 change: 0 additions & 1 deletion latest

This file was deleted.

0 comments on commit 13ad9c9

Please sign in to comment.