From 2c4a177c1729657c6251460d3a2815183a9f6227 Mon Sep 17 00:00:00 2001 From: Kelvin Wong <284779+netsgnut@users.noreply.github.com> Date: Fri, 26 Oct 2018 21:07:35 +0800 Subject: [PATCH] Use alpine build for Docker --- Dockerfile | 13 ++++++++++--- spec/ssh_scan/integration.sh | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a426197c..bcc3dcf9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby +FROM ruby:alpine MAINTAINER Jonathan Claudius ENV PROJECT=github.com/mozilla/ssh_scan @@ -6,6 +6,13 @@ RUN mkdir /app ADD . /app WORKDIR /app -RUN gem install bundler -RUN bundle install +# required for ssh-keyscan +RUN apk --update add openssh-client + +RUN apk --update add --virtual build-dependencies ruby-dev build-base && \ + gem install bundler --no-ri --no-rdoc && \ + bundle install && \ + apk del build-dependencies && \ + rm -rf /var/cache/apk/* + CMD /app/bin/ssh_scan diff --git a/spec/ssh_scan/integration.sh b/spec/ssh_scan/integration.sh index b4bb5a57..7764ae13 100755 --- a/spec/ssh_scan/integration.sh +++ b/spec/ssh_scan/integration.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh command_exists () { type "$1" &> /dev/null ;