From 7a27e3a0f4639fde91eb89d78f7703d02dcf0941 Mon Sep 17 00:00:00 2001 From: Josh Padnick Date: Fri, 9 Mar 2018 00:39:47 -0700 Subject: [PATCH 1/2] Add support for Amazon Linux. --- .../gruntwork-amzn-linux-test/Dockerfile | 14 ++++++++++++++ _docker-images/gruntwork-amzn-linux-test/README.md | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 _docker-images/gruntwork-amzn-linux-test/Dockerfile create mode 100644 _docker-images/gruntwork-amzn-linux-test/README.md diff --git a/_docker-images/gruntwork-amzn-linux-test/Dockerfile b/_docker-images/gruntwork-amzn-linux-test/Dockerfile new file mode 100644 index 000000000..a86ec34c6 --- /dev/null +++ b/_docker-images/gruntwork-amzn-linux-test/Dockerfile @@ -0,0 +1,14 @@ +# TODO: Is it worth referencing a specific tag instead of latest? +FROM amazonlinux:latest + +# Reduce Docker image size per https://blog.replicated.com/refactoring-a-dockerfile-for-image-size/ +# - The last line upgrades pip to the latest version. +RUN yum update -y && \ + yum upgrade -y && \ + yum install -y \ + jq \ + rsyslog \ + sudo \ + vim \ + wget && \ + yum clean all \ No newline at end of file diff --git a/_docker-images/gruntwork-amzn-linux-test/README.md b/_docker-images/gruntwork-amzn-linux-test/README.md new file mode 100644 index 000000000..00213925c --- /dev/null +++ b/_docker-images/gruntwork-amzn-linux-test/README.md @@ -0,0 +1,14 @@ +# Gruntwork Amazon-Linux-Test Docker Image + +The purpose of this Docker image is to provide a pre-built Amazon Linux Docker image that has most of the libraries +we would expect to be installed on the Amazon Linux AMI that would run in AWS. For example, we'd expect `sudo` in AWS, +but it doesn't exist by default in Docker `amazonlinux:latest`. + +### Building and Pushing a New Docker Image to Docker Hub + +This Docker image should publicly accessible via Docker Hub at https://hub.docker.com/r/gruntwork/amazonlinux-test/. To build and +upload it: + +1. `docker build -t gruntwork/amazonlinux-test:latest .` +1. `docker push gruntwork/amazonlinux-test:latest` + From 344fe68fa0086b14d573d56ecb7c7a69c89df95d Mon Sep 17 00:00:00 2001 From: Josh Padnick Date: Fri, 9 Mar 2018 01:07:23 -0700 Subject: [PATCH 2/2] Add CentOS7 Docker image. --- .../gruntwork-centos-test/Dockerfile | 25 +++++++++++++++++++ .../gruntwork-centos-test/README.md | 14 +++++++++++ .../gruntwork-ubuntu-test/Dockerfile | 9 ++++--- 3 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 _docker-images/gruntwork-centos-test/Dockerfile create mode 100644 _docker-images/gruntwork-centos-test/README.md diff --git a/_docker-images/gruntwork-centos-test/Dockerfile b/_docker-images/gruntwork-centos-test/Dockerfile new file mode 100644 index 000000000..9ff28b333 --- /dev/null +++ b/_docker-images/gruntwork-centos-test/Dockerfile @@ -0,0 +1,25 @@ +FROM centos:7 + +# Reduce Docker image size per https://blog.replicated.com/refactoring-a-dockerfile-for-image-size/ +# - The last line upgrades pip to the latest version. +RUN yum update -y && \ + yum upgrade -y && \ + yum install -y epel-release && \ + yum install -y \ + bind-utils \ + python-pip \ + rsyslog \ + sudo \ + vim \ + wget && \ + yum clean all + +# Install jq. Oddly, there's no RPM for jq, so we install the binary directly. https://serverfault.com/a/768061/199943 +RUN wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 && \ + chmod +x ./jq && \ + cp jq /usr/bin + +# Install the AWS CLI per https://docs.aws.amazon.com/cli/latest/userguide/installing.html +RUN pip install --upgrade pip && \ + pip install --upgrade setuptools && \ + pip install awscli --upgrade \ No newline at end of file diff --git a/_docker-images/gruntwork-centos-test/README.md b/_docker-images/gruntwork-centos-test/README.md new file mode 100644 index 000000000..a1ab7855d --- /dev/null +++ b/_docker-images/gruntwork-centos-test/README.md @@ -0,0 +1,14 @@ +# Gruntwork CentOS-Test Docker Image + +The purpose of this Docker image is to provide a pre-built CentOS 7 Docker image that has most of the libraries +we would expect to be installed on the CentOS 7 AMI that would run in AWS. For example, we'd expect `sudo` in AWS, +but it doesn't exist by default in Docker `centos:7`. + +### Building and Pushing a New Docker Image to Docker Hub + +This Docker image should publicly accessible via Docker Hub at https://hub.docker.com/r/gruntwork/centos-test/. To build and +upload it: + +1. `docker build -t gruntwork/centos-test:7 .` +1. `docker push gruntwork/centos-test:7` + diff --git a/_docker-images/gruntwork-ubuntu-test/Dockerfile b/_docker-images/gruntwork-ubuntu-test/Dockerfile index d9e5c3b54..912320fde 100644 --- a/_docker-images/gruntwork-ubuntu-test/Dockerfile +++ b/_docker-images/gruntwork-ubuntu-test/Dockerfile @@ -5,6 +5,7 @@ FROM ubuntu:16.04 RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install --no-install-recommends -y \ ca-certificates \ curl \ + dnsutils \ jq \ python-pip \ rsyslog \ @@ -12,9 +13,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install --no-instal sudo \ vim \ wget && \ - rm -rf /var/lib/apt/lists/* && \ - pip install --upgrade setuptools && \ - pip install --upgrade pip + rm -rf /var/lib/apt/lists/* # Install the AWS CLI per https://docs.aws.amazon.com/cli/latest/userguide/installing.html -RUN pip install awscli --upgrade \ No newline at end of file +RUN pip install --upgrade setuptools && \ + pip install --upgrade pip && \ + pip install awscli --upgrade \ No newline at end of file