├── .circleci └── config.yml ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── alpine-bash-curl └── Dockerfile ├── apib └── Dockerfile ├── awscli └── Dockerfile ├── clang ├── 4 │ └── Dockerfile ├── 5 │ └── Dockerfile └── 6 │ └── Dockerfile ├── coreapp-ci ├── circleci │ └── Dockerfile ├── node-python │ └── Dockerfile └── wercker │ └── Dockerfile ├── coreapp ├── 10 │ └── Dockerfile ├── 8-chrome-stable │ └── Dockerfile └── 8-npm6-chrome-stable │ └── Dockerfile ├── cpp └── Dockerfile ├── drafter-ci ├── clang-4.0 │ └── Dockerfile ├── clang-latest │ └── Dockerfile ├── gcc-4.9 │ └── Dockerfile └── gcc-latest │ └── Dockerfile ├── golang ├── Dockerfile └── glide │ └── Dockerfile ├── jekyll ├── Dockerfile └── node │ └── Dockerfile ├── mongodb ├── 3.2 │ └── Dockerfile └── 3.4 │ └── Dockerfile ├── nodejs-ruby ├── 4 │ └── Dockerfile ├── 0.12 │ └── Dockerfile └── script.sh ├── nodejs ├── 4 │ └── Dockerfile ├── 6 │ └── Dockerfile ├── 8 │ └── Dockerfile ├── 10 │ └── Dockerfile ├── 0.10 │ └── Dockerfile ├── 0.12 │ └── Dockerfile ├── 6-npm6 │ └── Dockerfile └── 8-npm6 │ └── Dockerfile ├── oci-cli ├── Dockerfile └── README.md ├── oraclelinux ├── node10 │ └── Dockerfile ├── node12 │ └── Dockerfile ├── node8 │ └── Dockerfile └── python36 │ └── Dockerfile ├── package.json ├── php └── Dockerfile ├── redis └── tls │ ├── Dockerfile │ ├── build.sh │ └── entry.sh ├── scripts ├── build-images.py ├── cleanup.sh ├── docker-build-images.sh ├── docker-internal-release.sh ├── getLatestStableNodePackage └── test.sh ├── sphinx-doc-npm ├── Dockerfile └── requirements.txt ├── sphinx-doc ├── Dockerfile └── requirements.txt └── sphinx-latex-doc └── Dockerfile /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | jobs: 3 | lint: 4 | docker: 5 | - image: circleci/node:10.16.3 6 | steps: 7 | - checkout # special step to check out source code to working directory 8 | - run: 9 | name: Install the dependencies 10 | command: npm install dockerlint 11 | - run: 12 | name: add dockerlint to path 13 | command: | 14 | echo 'export PATH=./node_modules/.bin:$PATH' >> $BASH_ENV 15 | source $BASH_ENV 16 | - run: 17 | name: Check Dockerfiles 18 | command: "./scripts/test.sh" 19 | build: 20 | docker: 21 | - image: circleci/python:3 22 | steps: 23 | - checkout 24 | - setup_remote_docker: 25 | docker_layer_caching: false 26 | - run: 27 | name: Build the images 28 | command: ./scripts/docker-build-images.sh 29 | 30 | deploy: 31 | docker: 32 | - image: circleci/python:3 33 | steps: 34 | - checkout 35 | - setup_remote_docker: 36 | docker_layer_caching: false 37 | - run: 38 | name: Build the images 39 | command: ./scripts/docker-build-images.sh 40 | - run: 41 | name: Copy image list to /tmp 42 | command: cp $CIRCLE_WORKING_DIRECTORY/images /tmp/ || true 43 | - run: 44 | name: Release docker images 45 | command: ./scripts/docker-internal-release.sh 46 | - run: 47 | name: Cleanup containers, volumes and built images 48 | command: ./scripts/cleanup.sh || true 49 | 50 | workflows: 51 | version: 2 52 | build_and_test: 53 | jobs: 54 | - lint 55 | - build: 56 | requires: 57 | - lint 58 | filters: 59 | branches: 60 | ignore: master 61 | - deploy: 62 | requires: 63 | - lint 64 | filters: 65 | branches: 66 | only: master 67 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiaryio/docker-base-images/0ab336a02501067b38dbfe1587b11182ab687a9b/.gitattributes -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | 3 | redis/tls/ghostunnel 4 | 5 | .wercker/ 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Apiary 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://circleci.com/gh/apiaryio/docker-base-images/tree/master.svg?style=svg)](https://circleci.com/gh/apiaryio/docker-base-images/tree/master) 2 | 3 | # Apiary Docker images 4 | 5 | This repository helps keep Apiary environment, services and libraries consistent and in sync. 6 | 7 | Each directory has an area of responsibility and the libraries should derive from the respective image. 8 | 9 | To keep the image size to its minimum, images are usually derived from minimal Debian image (apiaryio/debian-minimal) 10 | or Alpine Linux. 11 | 12 | Libraries use the minimal stack available. 13 | 14 | Some of the images use tags to differentiate between versions of an underlying library/system, such as apiaryio/coreapp 15 | image might be built on different Node.js versions. If this is the case, each tag has a separate Dockerfile in a folder 16 | with a tag name: 17 | 18 | ``` 19 | ./coreapp 20 | ./coreapp/0.10/Dockerfile 21 | ./coreapp/0.12/Dockerfile 22 | ``` 23 | 24 | ## Usage and maintenance 25 | 26 | 1. Drill into the respective directory 27 | 1. If doing major/arch change, update `REFRESHED_AT` in the Dockerfile 28 | 1. Build the Docker image with the tag expressed below: 29 | 30 | ```sh 31 | $ (sudo) docker build -t "apiaryio/$name:$tag" . 32 | ``` 33 | 34 | 1. Upload it to DockerHub 35 | 36 | ```sh 37 | $ (sudo) docker push -t "apiaryio/$name:$tag" 38 | ``` 39 | 40 | 1. When building Apiary app, use the proper `FROM:` directive inside your `Dockerfile` 41 | 42 | ## Adding a new image 43 | 44 | 1. Create a new repository for `apiaryio` in DockerHub. 45 | 1. Set Collaborators for that repository to SRE with admin rights. 46 | 1. Add a folder with the image name to this repository structure, e.g. `coreapp` 47 | 1. If multiple versions are needed, add subfolders with the tag names to the image folder, e.g. `8-chrome-stable`. 48 | 1. Build your image locally with `$ (sudo) docker build -t "apiaryio/$name:$tag" .`to make sure it works. You can skip the `$tag` and then `latest` will be used by default. 49 | 1. Log in to Docker Hub using `$ docker login` from the CLI if you haven't already. 50 | 1. If the image was built correctly, push it to the repository with `$ (sudo) docker push -t "apiaryio/$name:$tag"` 51 | 52 | Images are built automatically on Wercker. Builds on `master` branch include a deploy step with pushing the built 53 | images to DockerHub. If you add a new image as described above, your image will get built and pushed automatically once the changes are merged. 54 | 55 | 56 | ## Dredd docker image 57 | 58 | Dredd is an HTTP API testing tool. You can find out more about it at [its documentation](https://dredd.org) or its [code repository](https://github.com/apiaryio/dredd). Its Docker image [apiaryio/dredd](https://hub.docker.com/r/apiaryio/dredd/) has been moved to a [separate repository](https://github.com/apiaryio/dredd-docker). 59 | -------------------------------------------------------------------------------- /alpine-bash-curl/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | MAINTAINER apiary-sre_ww@oracle.com 3 | 4 | ENV REFRESHED_AT 2018-08-16 5 | 6 | RUN apk update && \ 7 | apk add bash \ 8 | curl 9 | 10 | CMD bash 11 | -------------------------------------------------------------------------------- /apib/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:boron 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2018-04-16 5 | 6 | RUN npm install -g aglio 7 | USER root 8 | RUN mkdir -p /doc 9 | 10 | RUN apt-get update -qqy && \ 11 | apt-get install -y software-properties-common python-software-properties && \ 12 | echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" > /etc/apt/sources.list.d/unstable.list && \ 13 | apt-get update -y && \ 14 | apt-get install -y \ 15 | gcc-5 \ 16 | gdb \ 17 | build-essential \ 18 | git-core \ 19 | ruby \ 20 | ruby-dev \ 21 | bundler && \ 22 | apt-get clean 23 | 24 | RUN echo "gem: --no-ri --no-rdoc" > ~/.gemrc 25 | 26 | RUN git clone --recursive https://github.com/apiaryio/drafter.git /tmp/drafter 27 | RUN cd /tmp/drafter && ./configure && make install 28 | 29 | CMD ["bash"] 30 | -------------------------------------------------------------------------------- /awscli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:alpine 2 | 3 | RUN apk --no-cache update && \ 4 | pip --no-cache-dir install awscli && \ 5 | rm -rf /var/cache/apk/* 6 | -------------------------------------------------------------------------------- /clang/4/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | ENV CLANG_VERSION=4.0.0 4 | 5 | RUN apt-get update && \ 6 | apt-get install -y curl xz-utils python build-essential git-core && \ 7 | curl -sL -o /tmp/clang-$CLANG_VERSION.tar.xz.sig http://releases.llvm.org/$CLANG_VERSION/clang+llvm-$CLANG_VERSION-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig && \ 8 | curl -sL -o /tmp/clang-$CLANG_VERSION.tar.xz http://releases.llvm.org/$CLANG_VERSION/clang+llvm-$CLANG_VERSION-x86_64-linux-gnu-ubuntu-16.04.tar.xz && \ 9 | gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B6C8F98282B944E3B0D5C2530FC3042E345AD05D && \ 10 | gpg --verify /tmp/clang-$CLANG_VERSION.tar.xz.sig && \ 11 | tar xvf /tmp/clang-$CLANG_VERSION.tar.xz -C /opt && \ 12 | rm -fr /tmp/* 13 | 14 | ENV CC=clang 15 | ENV CXX=clang++ 16 | ENV PATH="/opt/clang+llvm-$CLANG_VERSION-x86_64-linux-gnu-ubuntu-16.04/bin:${PATH}" 17 | 18 | CMD bash 19 | -------------------------------------------------------------------------------- /clang/5/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | ENV CLANG_VERSION=5.0.2 4 | 5 | RUN apt-get update && \ 6 | apt-get install -y curl xz-utils python build-essential git-core && \ 7 | curl -sL -o /tmp/clang-$CLANG_VERSION.tar.xz.sig http://releases.llvm.org/$CLANG_VERSION/clang+llvm-$CLANG_VERSION-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig && \ 8 | curl -sL -o /tmp/clang-$CLANG_VERSION.tar.xz http://releases.llvm.org/$CLANG_VERSION/clang+llvm-$CLANG_VERSION-x86_64-linux-gnu-ubuntu-16.04.tar.xz && \ 9 | gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 474E22316ABF4785A88C6E8EA2C794A986419D8A && \ 10 | gpg --verify /tmp/clang-$CLANG_VERSION.tar.xz.sig && \ 11 | tar xvf /tmp/clang-$CLANG_VERSION.tar.xz -C /opt && \ 12 | rm -fr /tmp/* 13 | 14 | ENV CC=clang 15 | ENV CXX=clang++ 16 | ENV PATH="/opt/clang+llvm-$CLANG_VERSION-x86_64-linux-gnu-ubuntu-16.04/bin:${PATH}" 17 | 18 | CMD bash 19 | -------------------------------------------------------------------------------- /clang/6/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | ENV CLANG_VERSION=6.0.0 4 | 5 | RUN apt-get update && \ 6 | apt-get install -y curl xz-utils python build-essential git-core && \ 7 | curl -sL -o /tmp/clang-$CLANG_VERSION.tar.xz.sig http://releases.llvm.org/$CLANG_VERSION/clang+llvm-$CLANG_VERSION-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig && \ 8 | curl -sL -o /tmp/clang-$CLANG_VERSION.tar.xz http://releases.llvm.org/$CLANG_VERSION/clang+llvm-$CLANG_VERSION-x86_64-linux-gnu-ubuntu-16.04.tar.xz && \ 9 | gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B6C8F98282B944E3B0D5C2530FC3042E345AD05D && \ 10 | gpg --verify /tmp/clang-$CLANG_VERSION.tar.xz.sig && \ 11 | tar xvf /tmp/clang-$CLANG_VERSION.tar.xz -C /opt && \ 12 | rm -fr /tmp/* 13 | 14 | ENV CC=clang 15 | ENV CXX=clang++ 16 | ENV PATH="/opt/clang+llvm-$CLANG_VERSION-x86_64-linux-gnu-ubuntu-16.04/bin:${PATH}" 17 | 18 | CMD bash 19 | -------------------------------------------------------------------------------- /coreapp-ci/circleci/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM circleci/python 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2019-05-10 5 | 6 | USER root 7 | 8 | RUN apt-get update \ 9 | && apt-get install -y --no-install-recommends gawk \ 10 | && pip install -U awscli oci-cli 11 | 12 | USER circleci 13 | -------------------------------------------------------------------------------- /coreapp-ci/node-python/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM circleci/node:10 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2020-11-02 5 | ENV NPM_VERSION 6.4.1 6 | 7 | USER root 8 | 9 | RUN apt-get update \ 10 | && apt-get install -y --no-install-recommends gawk python-pip python-dev python-setuptools \ 11 | && pip install -U awscli \ 12 | && npm i -g npm@${NPM_VERSION} 13 | 14 | USER circleci 15 | -------------------------------------------------------------------------------- /coreapp-ci/wercker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM apiaryio/coreapp-ci:circleci 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2018-08-27 5 | 6 | USER root 7 | -------------------------------------------------------------------------------- /coreapp/10/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM apiaryio/nodejs:10 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2019-10-23 5 | 6 | USER root 7 | 8 | RUN apt-get update \ 9 | && apt-get install -y wget apt-transport-https ca-certificates \ 10 | && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ 11 | && sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ 12 | && wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add - \ 13 | && sh -c 'echo "deb https://packages.sury.org/php/ jessie main" >> /etc/apt/sources.list.d/php.list' \ 14 | && apt-get update \ 15 | && apt-get install -y google-chrome-stable \ 16 | xvfb \ 17 | php-common \ 18 | php-cli \ 19 | php-curl \ 20 | libkrb5-dev \ 21 | ruby \ 22 | ruby-dev \ 23 | build-essential \ 24 | libssl-dev \ 25 | redis-tools \ 26 | vnc4server \ 27 | && gem install rest-client \ 28 | && /sbin/ldconfig -v 29 | 30 | RUN npm install -g coffee-script@1.11.0 grunt-cli@1.2.0 31 | RUN npm install -g node-gyp 32 | 33 | -------------------------------------------------------------------------------- /coreapp/8-chrome-stable/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM apiaryio/nodejs:8 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2018-04-24 5 | 6 | ENV MONGO_MAJOR 3.2 7 | ENV MONGO_VERSION 3.2.15 8 | ENV MONGO_GPG=EA312927 9 | USER root 10 | 11 | RUN apt-get install -y wget \ 12 | && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv $MONGO_GPG \ 13 | && echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/$MONGO_MAJOR main" > /etc/apt/sources.list.d/mongodb-org.list \ 14 | && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ 15 | && echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list.d/jessie.backports.list \ 16 | && sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ 17 | && apt-get update \ 18 | && apt-get install -y mongodb-org-shell=$MONGO_VERSION \ 19 | google-chrome-stable \ 20 | xvfb \ 21 | php-common \ 22 | php-cli \ 23 | php-curl \ 24 | libkrb5-dev \ 25 | ruby \ 26 | ruby-dev \ 27 | build-essential \ 28 | libssl-dev \ 29 | redis-tools \ 30 | vnc4server \ 31 | && gem install rest-client \ 32 | && /sbin/ldconfig -v 33 | 34 | RUN npm install -g coffee-script@1.11.0 grunt-cli@1.2.0 35 | RUN npm install -g node-gyp 36 | -------------------------------------------------------------------------------- /coreapp/8-npm6-chrome-stable/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM apiaryio/nodejs:8-npm6 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2019-02-12 5 | 6 | ENV MONGO_MAJOR 3.2 7 | ENV MONGO_VERSION 3.2.21 8 | ENV MONGO_GPG=EA312927 9 | USER root 10 | 11 | RUN apt-get install -y wget \ 12 | && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv $MONGO_GPG \ 13 | && echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/$MONGO_MAJOR main" > /etc/apt/sources.list.d/mongodb-org.list \ 14 | && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ 15 | && echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list.d/jessie.backports.list \ 16 | && sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ 17 | && apt-get update \ 18 | && apt-get install -y mongodb-org-shell=$MONGO_VERSION \ 19 | google-chrome-stable \ 20 | xvfb \ 21 | php-common \ 22 | php-cli \ 23 | php-curl \ 24 | libkrb5-dev \ 25 | ruby \ 26 | ruby-dev \ 27 | build-essential \ 28 | libssl-dev \ 29 | redis-tools \ 30 | vnc4server \ 31 | && gem install rest-client \ 32 | && /sbin/ldconfig -v 33 | 34 | RUN npm install -g coffee-script@1.11.0 grunt-cli@1.2.0 35 | RUN npm install -g node-gyp 36 | -------------------------------------------------------------------------------- /cpp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | MAINTAINER sre@apiary.io 3 | 4 | ENV REFRESHED_AT 2016-12-14 5 | 6 | RUN apk update && \ 7 | apk add alpine-sdk \ 8 | gcc \ 9 | g++ \ 10 | gdb \ 11 | git \ 12 | ruby \ 13 | ruby-dev \ 14 | ruby-bundler \ 15 | build-base libffi-dev 16 | 17 | RUN echo "gem: --no-ri --no-rdoc" > ~/.gemrc 18 | -------------------------------------------------------------------------------- /drafter-ci/clang-4.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch-slim 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y clang-4.0 make cmake git-core valgrind ruby ruby-dev ruby-aruba && \ 5 | update-alternatives --install /usr/bin/cc cc /usr/bin/clang-4.0 100 && \ 6 | update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-4.0 100 7 | 8 | CMD bash 9 | 10 | -------------------------------------------------------------------------------- /drafter-ci/clang-latest/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:sid-slim 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y clang-8 cmake git-core valgrind ruby ruby-dev ruby-aruba && \ 5 | update-alternatives --install /usr/bin/cc cc /usr/bin/clang-8 100 && \ 6 | update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-8 100 7 | 8 | CMD bash 9 | 10 | -------------------------------------------------------------------------------- /drafter-ci/gcc-4.9/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie-slim 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y gcc g++ make git-core valgrind ruby ruby-dev ruby-aruba wget && \ 5 | update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 100 && \ 6 | update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 100 && \ 7 | wget -O cmake-installer.sh https://github.com/Kitware/CMake/releases/download/v3.13.4/cmake-3.13.4-Linux-x86_64.sh && \ 8 | chmod +x cmake-installer.sh && \ 9 | ./cmake-installer.sh --skip-license --prefix=/usr/local 10 | 11 | CMD bash 12 | 13 | -------------------------------------------------------------------------------- /drafter-ci/gcc-latest/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:sid-slim 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y gcc g++ cmake git-core valgrind ruby ruby-dev ruby-aruba && \ 5 | update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 100 && \ 6 | update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 100 7 | 8 | CMD bash 9 | 10 | -------------------------------------------------------------------------------- /golang/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine 2 | MAINTAINER sre@apiary.io 3 | 4 | ENV REFRESHED_AT 2018-10-31 5 | 6 | RUN apk add --update git 7 | -------------------------------------------------------------------------------- /golang/glide/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang 2 | MAINTAINER sre@apiary.io 3 | 4 | ENV REFRESHED_AT 2018-10-31 5 | 6 | RUN curl -L -o glide.tar.gz https://github.com/Masterminds/glide/releases/download/v0.13.1/glide-v0.13.1-linux-amd64.tar.gz \ 7 | && tar -zxf glide.tar.gz \ 8 | && mv linux-amd64/glide ~/glide 9 | -------------------------------------------------------------------------------- /jekyll/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM apiaryio/debian-minimal 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2018-07-13 5 | 6 | # Requirements for installing using bundler 7 | # nodejs intentional as it is required as a javascript runtime for some ruby packages 8 | RUN apt-get update && \ 9 | apt-get install -y \ 10 | locales curl autoconf bison \ 11 | build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev \ 12 | git bundler ruby ruby-libxml nodejs 13 | 14 | RUN apt-get clean -y && \ 15 | apt-get autoclean -y && \ 16 | apt-get autoremove -y 17 | 18 | # Prepare UTF-8 environment, otehrwise jekyll will not run 19 | RUN locale-gen --purge C.UTF-8 && \ 20 | update-locale LC_ALL="C.UTF-8" 21 | 22 | # Set up user, and allow sudo as some bundler packages need it 23 | RUN mkdir -p /srv/jekyll && \ 24 | useradd -m jekyll 25 | 26 | WORKDIR /srv/jekyll 27 | -------------------------------------------------------------------------------- /jekyll/node/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM apiaryio/nodejs:8-npm6 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2018-07-13 5 | 6 | # Requirements for installing using bundler 7 | # nodejs intentional as it is required as a javascript runtime for some ruby packages 8 | RUN apt-get update && \ 9 | apt-get install -y \ 10 | locales curl autoconf bison \ 11 | build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev \ 12 | git bundler ruby ruby-libxml 13 | 14 | RUN apt-get clean -y && \ 15 | apt-get autoclean -y && \ 16 | apt-get autoremove -y 17 | 18 | # Prepare UTF-8 environment, otehrwise jekyll will not run 19 | RUN locale-gen --purge C.UTF-8 && \ 20 | update-locale LC_ALL="C.UTF-8" 21 | 22 | # Set up user, and allow sudo as some bundler packages need it 23 | RUN mkdir -p /srv/jekyll && \ 24 | useradd -m jekyll 25 | 26 | WORKDIR /srv/jekyll 27 | -------------------------------------------------------------------------------- /mongodb/3.2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mongo:3.2.15 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2017-07-24 5 | 6 | RUN chown -R mongodb:mongodb /data/db 7 | 8 | ENTRYPOINT ["/usr/bin/mongod", "--smallfiles", "--quiet"] 9 | -------------------------------------------------------------------------------- /mongodb/3.4/Dockerfile: -------------------------------------------------------------------------------- 1 | # do not upgrade to versions >3.4.18 as they are under the SSPL which is not OSS 2 | FROM mongo:3.4.18 3 | MAINTAINER Apiary 4 | 5 | ENV REFRESHED_AT 2019-07-25 6 | 7 | RUN chown -R mongodb:mongodb /data/db 8 | 9 | ENTRYPOINT ["/usr/bin/mongod", "--smallfiles", "--quiet"] 10 | -------------------------------------------------------------------------------- /nodejs-ruby/0.12/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM apiaryio/nodejs:0.12 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2016-07-18 5 | 6 | # (taken from https://github.com/docker-library/ruby/blob/master/2.3/Dockerfile) 7 | 8 | ENV RUBY_MAJOR 2.3 9 | ENV RUBY_VERSION 2.3.1 10 | ENV RUBY_DOWNLOAD_SHA256 b87c738cb2032bf4920fef8e3864dc5cf8eae9d89d8d523ce0236945c5797dcd 11 | ENV RUBYGEMS_VERSION 2.6.6 12 | ENV BUNDLER_VERSION 1.12.5 13 | ENV BUILD_DEPS 'bison libgdbm-dev ruby' 14 | 15 | # skip installing gem documentation 16 | RUN mkdir -p /usr/local/etc \ 17 | && { \ 18 | echo 'install: --no-document'; \ 19 | echo 'update: --no-document'; \ 20 | } >> /usr/local/etc/gemrc 21 | 22 | 23 | # some of ruby's build scripts are written in ruby 24 | # we purge this later to make sure our final image uses what we just built 25 | RUN set -ex \ 26 | && apt-get update \ 27 | && apt-get install -y --no-install-recommends $BUILD_DEPS \ 28 | && rm -rf /var/lib/apt/lists/* \ 29 | && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \ 30 | && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \ 31 | && mkdir -p /usr/src/ruby \ 32 | && tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \ 33 | && rm ruby.tar.gz \ 34 | && cd /usr/src/ruby \ 35 | && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ 36 | && autoconf \ 37 | && ./configure --disable-install-doc \ 38 | && make -j"$(nproc)" \ 39 | && make install \ 40 | && apt-get purge -y --auto-remove $BUILD_DEPS \ 41 | && gem update --system $RUBYGEMS_VERSION \ 42 | && rm -r /usr/src/ruby 43 | 44 | RUN gem install bundler --version "$BUNDLER_VERSION" 45 | 46 | # install things globally, for great justice 47 | # and don't create ".bundle" in all our apps 48 | ENV GEM_HOME /usr/local/bundle 49 | ENV BUNDLE_PATH="$GEM_HOME" \ 50 | BUNDLE_BIN="$GEM_HOME/bin" \ 51 | BUNDLE_SILENCE_ROOT_WARNING=1 \ 52 | BUNDLE_APP_CONFIG="$GEM_HOME" 53 | ENV PATH $BUNDLE_BIN:$PATH 54 | RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ 55 | && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" 56 | 57 | CMD ["irb"] 58 | -------------------------------------------------------------------------------- /nodejs-ruby/4/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM apiaryio/nodejs:4 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2017-03-16 5 | 6 | # (taken from https://github.com/docker-library/ruby/blob/master/2.3/Dockerfile) 7 | ENV RUBY_MAJOR 2.3 8 | ENV RUBY_VERSION 2.3.1 9 | ENV RUBY_DOWNLOAD_SHA256 b87c738cb2032bf4920fef8e3864dc5cf8eae9d89d8d523ce0236945c5797dcd 10 | ENV RUBYGEMS_VERSION 2.6.6 11 | ENV BUNDLER_VERSION 1.12.5 12 | ENV BUILD_DEPS 'bison libgdbm-dev ruby' 13 | 14 | # skip installing gem documentation 15 | RUN mkdir -p /usr/local/etc \ 16 | && { \ 17 | echo 'install: --no-document'; \ 18 | echo 'update: --no-document'; \ 19 | } >> /usr/local/etc/gemrc 20 | 21 | 22 | # some of ruby's build scripts are written in ruby 23 | # we purge this later to make sure our final image uses what we just built 24 | RUN set -ex \ 25 | && apt-get update \ 26 | && apt-get install -y --no-install-recommends $BUILD_DEPS \ 27 | && rm -rf /var/lib/apt/lists/* \ 28 | && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \ 29 | && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \ 30 | && mkdir -p /usr/src/ruby \ 31 | && tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \ 32 | && rm ruby.tar.gz \ 33 | && cd /usr/src/ruby \ 34 | && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ 35 | && autoconf \ 36 | && ./configure --disable-install-doc \ 37 | && make -j"$(nproc)" \ 38 | && make install \ 39 | && apt-get purge -y --auto-remove $BUILD_DEPS \ 40 | && gem update --system $RUBYGEMS_VERSION \ 41 | && rm -r /usr/src/ruby 42 | 43 | RUN gem install bundler --version "$BUNDLER_VERSION" 44 | 45 | # install things globally, for great justice 46 | # and don't create ".bundle" in all our apps 47 | ENV GEM_HOME /usr/local/bundle 48 | ENV BUNDLE_PATH="$GEM_HOME" \ 49 | BUNDLE_BIN="$GEM_HOME/bin" \ 50 | BUNDLE_SILENCE_ROOT_WARNING=1 \ 51 | BUNDLE_APP_CONFIG="$GEM_HOME" 52 | ENV PATH $BUNDLE_BIN:$PATH 53 | RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ 54 | && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" 55 | 56 | CMD ["irb"] 57 | -------------------------------------------------------------------------------- /nodejs-ruby/script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git clone https://github.com/sstephenson/rbenv.git ~/.rbenv 4 | git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build 5 | 6 | # for dockerfile commands 7 | echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile 8 | echo 'eval "$(rbenv init -)"' >> ~/.profile 9 | 10 | # for runnig bash commandline 11 | echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc 12 | echo 'eval "$(rbenv init -)"' >> ~/.bashrc 13 | 14 | eval "$(rbenv init -)" 15 | 16 | rbenv install -v $RUBY_VERSION 17 | rbenv global $RUBY_VERSION 18 | 19 | gem install bundler --version $BUNDLER_VERSION 20 | -------------------------------------------------------------------------------- /nodejs/0.10/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:0.10 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2016-10-19 5 | 6 | USER root 7 | RUN apt-get update && \ 8 | apt-get -y upgrade && \ 9 | apt-get clean -y && \ 10 | apt-get autoclean -y && \ 11 | apt-get autoremove -y && \ 12 | rm -rf /usr/share/locale/* && \ 13 | rm -rf /var/cache/debconf/*-old && \ 14 | rm -rf /var/lib/apt/lists/* && \ 15 | rm -rf /usr/share/doc/* 16 | -------------------------------------------------------------------------------- /nodejs/0.12/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:0.12 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2016-12-20 5 | ENV NPM_VERSION=2.15.11 6 | 7 | USER root 8 | 9 | # due to https://github.com/nodejs/docker-node/commit/4a722c29c0e52624af8b72b4711ebeba8ea39463 10 | RUN userdel node 11 | 12 | RUN apt-get update && \ 13 | apt-get -y upgrade && \ 14 | apt-get clean -y && \ 15 | apt-get autoclean -y && \ 16 | apt-get autoremove -y && \ 17 | rm -rf /usr/share/locale/* && \ 18 | rm -rf /var/cache/debconf/*-old && \ 19 | rm -rf /var/lib/apt/lists/* && \ 20 | rm -rf /usr/share/doc/* 21 | 22 | RUN npm install -g npm@$NPM_VERSION 23 | -------------------------------------------------------------------------------- /nodejs/10/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:10.15.3-stretch 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2019-08-13 5 | ENV NPM_VERSION=6.4.1 6 | 7 | USER root 8 | 9 | # due to https://github.com/nodejs/docker-node/commit/4a722c29c0e52624af8b72b4711ebeba8ea39463 10 | RUN userdel node 11 | 12 | RUN apt-get update && \ 13 | apt-get -y upgrade && \ 14 | apt-get clean -y && \ 15 | apt-get autoclean -y && \ 16 | apt-get autoremove -y && \ 17 | rm -rf /usr/share/locale/* && \ 18 | rm -rf /var/cache/debconf/*-old && \ 19 | rm -rf /var/lib/apt/lists/* && \ 20 | rm -rf /usr/share/doc/* 21 | 22 | RUN npm install -g npm@$NPM_VERSION 23 | -------------------------------------------------------------------------------- /nodejs/4/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:argon 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2018-08-16 5 | ENV NPM_VERSION=4.4.4 6 | 7 | USER root 8 | 9 | # due to https://github.com/nodejs/docker-node/commit/4a722c29c0e52624af8b72b4711ebeba8ea39463 10 | RUN userdel node 11 | 12 | RUN apt-get update && \ 13 | apt-get -y upgrade && \ 14 | apt-get clean -y && \ 15 | apt-get autoclean -y && \ 16 | apt-get autoremove -y && \ 17 | rm -rf /usr/share/locale/* && \ 18 | rm -rf /var/cache/debconf/*-old && \ 19 | rm -rf /var/lib/apt/lists/* && \ 20 | rm -rf /usr/share/doc/* 21 | 22 | RUN npm install -g npm@$NPM_VERSION 23 | -------------------------------------------------------------------------------- /nodejs/6-npm6/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:boron 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2018-12-05 5 | ENV NPM_VERSION=6.1.0 6 | 7 | USER root 8 | 9 | # due to https://github.com/nodejs/docker-node/commit/4a722c29c0e52624af8b72b4711ebeba8ea39463 10 | RUN userdel node 11 | 12 | RUN apt-get update && \ 13 | apt-get -y upgrade && \ 14 | apt-get clean -y && \ 15 | apt-get autoclean -y && \ 16 | apt-get autoremove -y && \ 17 | rm -rf /usr/share/locale/* && \ 18 | rm -rf /var/cache/debconf/*-old && \ 19 | rm -rf /var/lib/apt/lists/* && \ 20 | rm -rf /usr/share/doc/* 21 | 22 | RUN npm install -g npm@$NPM_VERSION 23 | -------------------------------------------------------------------------------- /nodejs/6/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:boron 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2018-12-05 5 | ENV NPM_VERSION=4.6.1 6 | 7 | USER root 8 | 9 | # due to https://github.com/nodejs/docker-node/commit/4a722c29c0e52624af8b72b4711ebeba8ea39463 10 | RUN userdel node 11 | 12 | RUN apt-get update && \ 13 | apt-get -y upgrade && \ 14 | apt-get clean -y && \ 15 | apt-get autoclean -y && \ 16 | apt-get autoremove -y && \ 17 | rm -rf /usr/share/locale/* && \ 18 | rm -rf /var/cache/debconf/*-old && \ 19 | rm -rf /var/lib/apt/lists/* && \ 20 | rm -rf /usr/share/doc/* 21 | 22 | RUN npm install -g npm@$NPM_VERSION 23 | -------------------------------------------------------------------------------- /nodejs/8-npm6/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:carbon 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2019-02-12 5 | ENV NPM_VERSION=6.4.1 6 | 7 | USER root 8 | 9 | # due to https://github.com/nodejs/docker-node/commit/4a722c29c0e52624af8b72b4711ebeba8ea39463 10 | RUN userdel node 11 | 12 | RUN apt-get update && \ 13 | apt-get -y upgrade && \ 14 | apt-get clean -y && \ 15 | apt-get autoclean -y && \ 16 | apt-get autoremove -y && \ 17 | rm -rf /usr/share/locale/* && \ 18 | rm -rf /var/cache/debconf/*-old && \ 19 | rm -rf /var/lib/apt/lists/* && \ 20 | rm -rf /usr/share/doc/* 21 | 22 | RUN npm install -g npm@$NPM_VERSION 23 | -------------------------------------------------------------------------------- /nodejs/8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:carbon 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2018-12-05 5 | ENV NPM_VERSION=4.6.1 6 | 7 | USER root 8 | 9 | # due to https://github.com/nodejs/docker-node/commit/4a722c29c0e52624af8b72b4711ebeba8ea39463 10 | RUN userdel node 11 | 12 | RUN apt-get update && \ 13 | apt-get -y upgrade && \ 14 | apt-get clean -y && \ 15 | apt-get autoclean -y && \ 16 | apt-get autoremove -y && \ 17 | rm -rf /usr/share/locale/* && \ 18 | rm -rf /var/cache/debconf/*-old && \ 19 | rm -rf /var/lib/apt/lists/* && \ 20 | rm -rf /usr/share/doc/* 21 | 22 | RUN npm install -g npm@$NPM_VERSION 23 | -------------------------------------------------------------------------------- /oci-cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM apiaryio/oraclelinux:python36 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2020-11-02 5 | ENV LC_ALL en_US.UTF-8 6 | 7 | RUN pip3 install oci-cli 8 | RUN useradd -m oci 9 | USER oci 10 | 11 | ENTRYPOINT [ "oci" ] 12 | -------------------------------------------------------------------------------- /oci-cli/README.md: -------------------------------------------------------------------------------- 1 | # apiaryio/oci-cli 2 | 3 | Docker image for [OCI CLI](https://github.com/oracle/oci-cli) built on Oracle Linux 4 | 5 | ## Setup 6 | 7 | These steps will result in having OCI CLI configuration files in your home directory (`~/.oci`): 8 | 9 | 1. Run ```docker run -it -v ~/:/home/oci apiaryio/oci-cli setup config``` 10 | 1. Fill out the requested data 11 | 12 | > Note: If OCI CLI generated a key-pair, upload the public part in the OCI console as described [here] (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm#How2). 13 | 14 | ## Usage 15 | 16 | Given the OCI CLI is configured already and the configuration files are in `~/.oci`, run: 17 | 18 | ``` 19 | docker run -it -v ~/:/home/oci apiaryio/oci-cli 20 | ``` 21 | 22 | > Tip: define a function in your bash profile to have a single command handy: 23 | 24 | ``` 25 | oci() { 26 | docker run -it -v ~/:/home/oci apiaryio/oci-cli "$@" 27 | } 28 | ``` 29 | -------------------------------------------------------------------------------- /oraclelinux/node10/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM oraclelinux:7-slim 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2020-11-13 5 | ENV NODEJS_VERSION_MAJOR 10 6 | ENV NPM_VERSION 6.4.1 7 | 8 | USER root 9 | 10 | RUN yum install -y oracle-nodejs-release-el7 \ 11 | && yum-config-manager --enable ol7_developer_nodejs${NODEJS_VERSION_MAJOR} \ 12 | && yum install -y nodejs-${NODEJS_VERSION_MAJOR}.* \ 13 | && yum install -y gcc gcc-c++ autoconf automake make \ 14 | && npm i -g npm@${NPM_VERSION} \ 15 | && yum clean all \ 16 | && mkdir -p /app 17 | 18 | WORKDIR /app 19 | 20 | RUN node -v 21 | RUN npm -v 22 | 23 | ENTRYPOINT [ "bash" ] 24 | -------------------------------------------------------------------------------- /oraclelinux/node12/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM oraclelinux:7-slim 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2020-11-13 5 | ENV NODEJS_VERSION_MAJOR 12 6 | ENV NPM_VERSION 6.13.4 7 | 8 | USER root 9 | 10 | RUN yum install -y oracle-nodejs-release-el7 \ 11 | && yum-config-manager --enable ol7_developer_nodejs${NODEJS_VERSION_MAJOR} \ 12 | && yum install -y nodejs-${NODEJS_VERSION_MAJOR}.* \ 13 | && yum install -y gcc gcc-c++ autoconf automake make \ 14 | && npm i -g npm@${NPM_VERSION} \ 15 | && yum clean all \ 16 | && mkdir -p /app 17 | 18 | WORKDIR /app 19 | 20 | RUN node -v 21 | RUN npm -v 22 | 23 | ENTRYPOINT [ "bash" ] 24 | -------------------------------------------------------------------------------- /oraclelinux/node8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM oraclelinux:7-slim 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2019-11-20 5 | ENV NODEJS_VERSION_MAJOR 8 6 | ENV NPM_VERSION 5.6.0 7 | 8 | USER root 9 | 10 | USER root 11 | 12 | RUN yum install -y oracle-nodejs-release-el7 \ 13 | && yum-config-manager --enable ol7_developer_nodejs${NODEJS_VERSION_MAJOR} \ 14 | && yum install -y nodejs \ 15 | && npm i -g npm@${NPM_VERSION} \ 16 | && mkdir -p /app 17 | 18 | WORKDIR /app 19 | 20 | RUN node -v 21 | RUN npm -v 22 | 23 | ENTRYPOINT [ "bash" ] 24 | -------------------------------------------------------------------------------- /oraclelinux/python36/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM oraclelinux:7-slim 2 | LABEL maintainer="Apiary " 3 | 4 | ENV REFRESHED_AT 2021-02-02 5 | 6 | USER root 7 | 8 | RUN yum install -y yum-utils && yum-config-manager --enable ol7_developer_EPEL && \ 9 | yum install -y scl-utils python36 python36-setuptools && \ 10 | easy_install-3.6 pip 11 | 12 | ENTRYPOINT [ "/usr/bin/python3" ] 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docker-base-images", 3 | "version": "1.0.0", 4 | "description": "This repository helps to keep Apiary environment, services and libraries consistent and in sync.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "bash scripts/test.sh" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/apiaryio/docker-base-images.git" 12 | }, 13 | "author": "", 14 | "license": "MIT", 15 | "bugs": { 16 | "url": "https://github.com/apiaryio/docker-base-images/issues" 17 | }, 18 | "homepage": "https://github.com/apiaryio/docker-base-images#readme", 19 | "dependencies": { 20 | "dockerlint": "0.1.4", 21 | "npm-registry": "" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.6-apache 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2015-04-03 5 | 6 | RUN a2enmod rewrite && \ 7 | curl -sS https://getcomposer.org/installer | php && \ 8 | mv composer.phar /usr/local/bin/composer && \ 9 | chmod 755 /usr/local/bin/composer 10 | -------------------------------------------------------------------------------- /redis/tls/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | MAINTAINER sre@apiary.io 3 | 4 | ENV REFRESHED_AT 2016-12-13 5 | 6 | RUN mkdir -p /go/bin && chmod -R 777 /go 7 | ENV GOPATH /go 8 | ENV PATH /go/bin:$PATH 9 | 10 | COPY ghostunnel /go/bin 11 | 12 | RUN apk add --update redis ca-certificates 13 | 14 | # Configure redis to listen on UNIX socket 15 | RUN \ 16 | sed -i 's/^\(bind .*\)$/# \1/' /etc/redis.conf && \ 17 | sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis.conf && \ 18 | sed -i 's/^\(dir .*\)$/dir \/data/' /etc/redis.conf && \ 19 | sed -i 's/^\(logfile .*\)$/# \1/' /etc/redis.conf && \ 20 | sed -i 's/^\(port .*\)$/port 0/' /etc/redis.conf && \ 21 | sed -i 's/^# \(unixsocket .*\)$/\1/' /etc/redis.conf && \ 22 | sed -i 's/^# \(unixsocketperm .*\)$/\1/' /etc/redis.conf && \ 23 | mkdir -p /data && mkdir -p /data/secrets && \ 24 | chown -R redis:redis /data && chown -R redis:redis /data/secrets 25 | 26 | # Define mountable directories. 27 | VOLUME ["/data"] 28 | VOLUME ["/data/secrets"] 29 | 30 | WORKDIR /data 31 | 32 | COPY entry.sh /entry.sh 33 | ENTRYPOINT ["/entry.sh"] 34 | 35 | EXPOSE 6379 36 | 37 | # To run, with given arguments to terminate TLS connections (for example): 38 | # docker run \ 39 | # --name redis-tls \ 40 | # -p 6379:6379 \ 41 | # -v $SECRETS_PATH:/secrets \ 42 | # redis-tls \ 43 | # --keystore=/secrets/server-keystore.p12 \ 44 | # --cacert=/secrets/ca-bundle.crt \ 45 | # --allow-cn client 46 | -------------------------------------------------------------------------------- /redis/tls/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker run -v "${PWD}"/redis/tls/:/go/bin apiaryio/golang go get -u github.com/square/ghostunnel 4 | 5 | docker build --no-cache -t apiaryio/redis:tls -f redis/tls/Dockerfile redis/tls/ 6 | -------------------------------------------------------------------------------- /redis/tls/entry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | REDIS_CONFIG='/etc/redis.conf' 4 | REDIS_SOCKET=`grep 'unixsocket .*' $REDIS_CONFIG | cut -d' ' -f2` 5 | 6 | exec ghostunnel server --listen 0.0.0.0:6379 --target unix:$REDIS_SOCKET "$@" -- redis-server $REDIS_CONFIG 7 | -------------------------------------------------------------------------------- /scripts/build-images.py: -------------------------------------------------------------------------------- 1 | import os, re, sys, subprocess 2 | 3 | from argparse import ArgumentParser 4 | from glob import glob 5 | 6 | class DockerImage: 7 | def __init__(self, dockerfile, versioned=False): 8 | self.dockerfile = dockerfile 9 | self.dockerfile_folder = os.path.dirname(self.dockerfile) 10 | self.versioned = versioned 11 | self._set_name() 12 | self._set_parent_name() 13 | self._extra_build() 14 | 15 | def _set_parent_name(self): 16 | df = open(self.dockerfile).read() 17 | m = re.search('FROM\s+([a-z0-9\/\-\:\.]+)', df) 18 | self.parent_name = (m.group(1)).strip() 19 | 20 | def _set_name(self): 21 | df_location = os.path.dirname(self.dockerfile) 22 | self.name = os.path.split(df_location)[1] 23 | if self.versioned: 24 | self.tag = self.name 25 | self.name = os.path.split(os.path.dirname(df_location))[1] 26 | else: 27 | self.tag = 'latest' 28 | self.full_name = "apiaryio/{0}:{1}".format(self.name, self.tag) 29 | self.print_name = "{0}_{1}".format(self.name, self.tag) 30 | 31 | def _extra_build(self): 32 | df_location = os.path.dirname(self.dockerfile) 33 | if os.path.isfile(os.path.join(df_location, 'build.sh')): 34 | self.extra = True 35 | else: 36 | self.extra = False 37 | 38 | def update_images_to_rebuild(rebuild_all, changed_files=None): 39 | if rebuild_all or not changed_files: 40 | print('Rebuilding all images') 41 | images_to_rebuild.update([image.full_name for image in all_images.values()]) 42 | else: 43 | print('Selecting images for rebuild') 44 | for cf in changed_files: 45 | for image in all_images.values(): 46 | if image.name in cf: 47 | if image.versioned and image.tag not in cf: 48 | print("Won't add {0} as nothing changed for this tag".format(image.full_name)) 49 | continue 50 | print('Adding {0} because {1} has changed'.format(image.full_name, cf)) 51 | images_to_rebuild.add(image.full_name) 52 | if len(images_to_rebuild) != len(all_images): 53 | for image in all_images.values(): 54 | if image.parent_name in images_to_rebuild: 55 | print("Adding {0} because it's parent ({1}) has changed".format(image.full_name, image.parent_name)) 56 | images_to_rebuild.add(image.full_name) 57 | 58 | def add_image_ordered(image_name): 59 | image = all_images[image_name] 60 | if image.parent_name in images_to_rebuild: 61 | parent_image = all_images[image.parent_name] 62 | add_image_ordered(parent_image.full_name) 63 | if image not in sorted_images_to_rebuild: 64 | sorted_images_to_rebuild.append(image) 65 | 66 | all_images = {} 67 | images_to_rebuild = set() 68 | sorted_images_to_rebuild = [] 69 | 70 | parser = ArgumentParser() 71 | parser.add_argument('-a', '--rebuild-all') 72 | parser.add_argument('-f', '--changed-files') 73 | parser.add_argument('-t', '--dry-run') 74 | args = parser.parse_args() 75 | rebuild_all = args.rebuild_all == '1' 76 | changed_files = [] 77 | dry_run = False 78 | if args.dry_run and args.dry_run == '1': 79 | dry_run = True 80 | if args.changed_files: 81 | changed_files = args.changed_files.split('\n') 82 | print(changed_files) 83 | 84 | dockerfiles = glob("./*/Dockerfile") 85 | dockerfiles_versioned = glob("./*/*/Dockerfile") 86 | 87 | for df in dockerfiles: 88 | image = DockerImage(df) 89 | all_images[image.full_name] = image 90 | 91 | for df in dockerfiles_versioned: 92 | image = DockerImage(df, versioned=True) 93 | all_images[image.full_name] = image 94 | 95 | update_images_to_rebuild(rebuild_all, changed_files) 96 | 97 | for image_name in images_to_rebuild: 98 | add_image_ordered(image_name) 99 | 100 | if not sorted_images_to_rebuild: 101 | print('No images need to be rebuilt') 102 | else: 103 | print('These images will be rebuilt (in this order): ' + ', '.join([image.full_name for image in sorted_images_to_rebuild])) 104 | for image in sorted_images_to_rebuild: 105 | print('Building ' + image.full_name) 106 | if dry_run: 107 | print('!!! Warning: Skipping image build due to DRY-RUN mode. Would have built: {0}'.format(image.full_name)) 108 | return_code = 0 109 | else: 110 | if image.extra: 111 | return_code = subprocess.call(os.path.join(image.dockerfile_folder,"build.sh"), shell=True) 112 | if return_code != 0: 113 | print('Error building {0}'.format(image.full_name)) 114 | sys.exit(1) 115 | else: 116 | args_build = ["docker", "build"] 117 | network_name = os.getenv("DOCKER_NETWORK_NAME") 118 | if network_name: 119 | args_build += ["--network", network_name] 120 | args_build += ["-t", image.full_name, "-f", image.dockerfile, image.dockerfile_folder] 121 | print(args_build) 122 | args_cat = ["cat"] 123 | process_build = subprocess.Popen(args_build, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False) 124 | process_cat = subprocess.Popen(args_cat, stdin=process_build.stdout, stdout=subprocess.PIPE, shell=False) 125 | process_build.stdout.close() 126 | output = process_cat.communicate()[0] 127 | print(output) 128 | return_code = process_build.wait() 129 | if return_code != 0: 130 | print('Error building {0}'.format(image.full_name)) 131 | sys.exit(1) 132 | 133 | tmp_image_file = open("/tmp/images", 'w') 134 | tmp_image_file.write('{0}'.format(" ".join([image.full_name for image in sorted_images_to_rebuild]))) 135 | -------------------------------------------------------------------------------- /scripts/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Running docker container prune -f..." 4 | docker container prune -f || true 5 | 6 | for IMAGE in $(cat /tmp/images); do 7 | echo "Removing ${IMAGE}" 8 | docker rmi $IMAGE || true 9 | done 10 | 11 | echo "Running docker volume prune -f..." 12 | docker volume prune -f || true 13 | -------------------------------------------------------------------------------- /scripts/docker-build-images.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | echo "CIRCLE_SHA1: $CIRCLE_SHA1" 5 | echo "CIRCLE_BRANCH: $CIRCLE_BRANCH" 6 | echo "REBUILD_ALL: $REBUILD_ALL" 7 | echo "DRY_RUN: $DRY_RUN" 8 | 9 | REBUILD_ALL=${REBUILD_ALL:-0} 10 | DRY_RUN=${DRY_RUN:-0} 11 | 12 | if [ $REBUILD_ALL != 1 ]; then 13 | if [ "$CIRCLE_BRANCH" = "master" ]; then 14 | CHANGED_FILES=`git diff --name-only $(git log --merges -1 --pretty=format:%P)` 15 | else 16 | CHANGED_FILES=`git diff --name-only $(git merge-base origin/master HEAD)` 17 | fi 18 | echo "CHANGED_FILES=$CHANGED_FILES" 19 | fi 20 | 21 | python ./scripts/build-images.py -a $REBUILD_ALL -f "$CHANGED_FILES" -t "$DRY_RUN" 22 | -------------------------------------------------------------------------------- /scripts/docker-internal-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z "$IMAGES" ]; then 4 | if [ -e /tmp/images ]; then 5 | IMAGES=`cat /tmp/images` 6 | fi 7 | if [ -z "$IMAGES" ]; then 8 | echo "No IMAGES set, skipping the internal release" 9 | exit 0 10 | fi 11 | fi 12 | 13 | function exitOnError { 14 | EXIT_CODE=$? 15 | if [ $EXIT_CODE -ne 0 ]; then 16 | echo "$1 failed with code $EXIT_CODE" 17 | exit $EXIT_CODE 18 | fi 19 | } 20 | 21 | echo "Authenticating with Docker Hub..." 22 | if [[ -z "$DOCKER_EMAIL" || -z "$DOCKER_USER" || -z "$DOCKER_PASS" ]]; then 23 | exitOnError "DockerHub credentials are missing (DOCKER_EMAIL, DOCKER_USER, DOCKER_PASS), cannot proceed." 24 | fi 25 | 26 | CREDENTIALS_FILE=~/.docker/config.json 27 | if [[ -e $CREDENTIALS_FILE && ! -w $CREDENTIALS_FILE ]]; then 28 | exitOnError "Found $CREDENTIALS_FILE but it's not writable, cannot proceed." 29 | fi 30 | 31 | echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin 32 | exitOnError "docker login" 33 | 34 | for IMAGE_NAME in $IMAGES 35 | do 36 | echo "Preparing to push $IMAGE_NAME..." 37 | echo "Pushing $IMAGE_NAME..." 38 | docker push $IMAGE_NAME 39 | exitOnError "pushing $IMAGE_NAME" 40 | echo "$IMAGE_NAME pushed successfully" 41 | done 42 | echo "All done!" 43 | -------------------------------------------------------------------------------- /scripts/getLatestStableNodePackage: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | if (process.argv[2]!==undefined) { 3 | var Registry = require('npm-registry'); 4 | var npm = new Registry({'registry': "https://registry.npmjs.org/'"}); 5 | npm.packages.get(process.argv[2], function (err, data) { 6 | if (err) { 7 | console.error(err); 8 | } else { 9 | console.log(data[0]['dist-tags']['stable']); 10 | } 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /scripts/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set +o pipefail 3 | find . -name "Dockerfile" -print0 | xargs -0 -n1 dockerlint -f $1 4 | set -o pipefail 5 | -------------------------------------------------------------------------------- /sphinx-doc-npm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM apiaryio/sphinx-doc:latest 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2020-11-02 5 | 6 | COPY requirements.txt /tmp/ 7 | 8 | RUN apt-get install -y npm && \ 9 | pip install -r /tmp/requirements.txt 10 | 11 | RUN ln -s /usr/bin/nodejs /usr/bin/node || true 12 | 13 | RUN npm install -g coffeedoc coffee-script 14 | 15 | RUN mkdir /mnt/lib 16 | 17 | WORKDIR /mnt/lib 18 | VOLUME ["/mnt/lib"] 19 | 20 | CMD ["make", "clean", "html"] 21 | -------------------------------------------------------------------------------- /sphinx-doc-npm/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinxcontrib-coffee -------------------------------------------------------------------------------- /sphinx-doc/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stable-slim 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2020-11-02 5 | 6 | COPY requirements.txt /tmp/ 7 | 8 | RUN apt-get update && \ 9 | apt-get install -y --no-install-recommends \ 10 | python-sphinx \ 11 | python-yaml \ 12 | python-setuptools \ 13 | graphviz \ 14 | make \ 15 | python-pip \ 16 | git && \ 17 | pip install --upgrade pip setuptools wheel && \ 18 | pip install -r /tmp/requirements.txt 19 | 20 | RUN mkdir /mnt/docs 21 | 22 | WORKDIR /mnt/docs 23 | VOLUME ["/mnt/docs"] 24 | 25 | CMD ["make", "clean", "html"] 26 | -------------------------------------------------------------------------------- /sphinx-doc/requirements.txt: -------------------------------------------------------------------------------- 1 | Sphinx>=1.8.5 2 | sphinx_rtd_theme 3 | commonmark>=0.5.5 4 | recommonmark 5 | pygments>=2.1 6 | PyYAML 7 | sphinx-autobuild 8 | sphinxcontrib-apiblueprint 9 | sphinx-git 10 | sphinx_tabs 11 | -------------------------------------------------------------------------------- /sphinx-latex-doc/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM apiaryio/sphinx-doc:latest 2 | MAINTAINER Apiary 3 | 4 | ENV REFRESHED_AT 2020-11-02 5 | 6 | RUN apt-get install -y --no-install-recommends \ 7 | texlive \ 8 | texlive-latex-extra \ 9 | texlive-fonts-recommended \ 10 | texlive-fonts-extra \ 11 | rst2pdf \ 12 | latexmk 13 | 14 | CMD ["make", "clean", "html", "latexpdf"] 15 | --------------------------------------------------------------------------------