Skip to content

Commit

Permalink
Merge pull request #59 from gruntwork-io/more-docker
Browse files Browse the repository at this point in the history
Add baseline Docker images for Amazon Linux and CentOS 7
  • Loading branch information
josh-padnick authored Mar 11, 2018
2 parents 8adb345 + 344fe68 commit 80086cc
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 4 deletions.
14 changes: 14 additions & 0 deletions _docker-images/gruntwork-amzn-linux-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions _docker-images/gruntwork-amzn-linux-test/README.md
Original file line number Diff line number Diff line change
@@ -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`

25 changes: 25 additions & 0 deletions _docker-images/gruntwork-centos-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions _docker-images/gruntwork-centos-test/README.md
Original file line number Diff line number Diff line change
@@ -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`

9 changes: 5 additions & 4 deletions _docker-images/gruntwork-ubuntu-test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ 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 \
software-properties-common \
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
RUN pip install --upgrade setuptools && \
pip install --upgrade pip && \
pip install awscli --upgrade

0 comments on commit 80086cc

Please sign in to comment.