Skip to content

Commit

Permalink
fix bundler for multi-target dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
wr0ngway committed Jun 22, 2021
1 parent 26b410c commit 5a8f7d0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ENV APP_DIR="/srv/app" \
# values because Docker will read the values once before it starts setting
# values.
ENV BUNDLE_BIN="${BUNDLE_PATH}/bin" \
BUNDLE_APP_CONFIG="${BUNDLE_PATH}" \
GEM_HOME="${BUNDLE_PATH}"
ENV PATH="${APP_DIR}:${APP_DIR}/bin:${BUNDLE_BIN}:${PATH}"

Expand All @@ -28,7 +29,7 @@ RUN apk add --no-cache \
$BUILD_PACKAGES

COPY Gemfile* $APP_DIR/
RUN bundle config --global without 'development test' && \
RUN bundle config --local without 'development test' && \
bundle install --jobs=4

RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing kubectl
Expand All @@ -38,7 +39,7 @@ COPY . $APP_DIR/

FROM build as development

RUN bundle config --delete without && \
RUN bundle config --local --delete without && \
bundle install --jobs=4

# Specify the script to use when running the container
Expand Down
1 change: 1 addition & 0 deletions bin/kubetruth
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby

$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "bundler/setup"

require "kubetruth"
require 'kubetruth/cli'
Expand Down
1 change: 1 addition & 0 deletions bin/liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby

$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "bundler/setup"

require "kubetruth"
require 'kubetruth/cli_liquid_tester'
Expand Down
11 changes: 3 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ case $action in

app)
echo "Starting app"
exec bundle exec kubetruth "$@"
exec kubetruth "$@"
;;

console)
echo "Starting console"
exec bundle exec rake console
exec rake console
;;

test)
echo "Starting tests"
exec bundle exec rspec
exec rspec
;;

bash)
Expand All @@ -31,12 +31,7 @@ case $action in
exec bash "${bash_args[@]}"
;;

exec)
exec "$@"
;;

*)
echo "Unknown action: '$action', defaulting to exec"
exec $action "$@"
;;

Expand Down

0 comments on commit 5a8f7d0

Please sign in to comment.