Skip to content

Instantly share code, notes, and snippets.

@hmarcelodn
Created January 8, 2019 04:00
Show Gist options
  • Save hmarcelodn/5d383b4cd5cf4935cd276325cf1f9181 to your computer and use it in GitHub Desktop.
Save hmarcelodn/5d383b4cd5cf4935cd276325cf1f9181 to your computer and use it in GitHub Desktop.
Docker CircleCI Custom
FROM debian
# Environment Variables
ENV VER=17.03.0-ce
# Installing Utilities
RUN apt-get clean
RUN apt-get update
RUN apt-get install curl -y
RUN apt-get install gnupg2 -y
RUN apt-get install -y build-essential
RUN apt-get install git-core -y
RUN apt install vim -y
# Installing Kubectl
RUN apt-get update
RUN apt-get install apt-transport-https -y
RUN curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
RUN touch /etc/apt/sources.list.d/kubernetes.list
RUN echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list
RUN apt-get update
RUN apt-get install -y kubectl
# Installing Kops
RUN curl -LO https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64
RUN chmod +x kops-linux-amd64
RUN mv kops-linux-amd64 /usr/local/bin/kops
# Installing Helm
RUN curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
RUN chmod 700 get_helm.sh
RUN ./get_helm.sh
# Setup configuration
RUN /usr/local/bin/kops export kubecfg ${NAME}
# Copy release scripts and provide execution permissions
ADD artifacts/helm-launcher.sh /usr/local/bin/helm-launcher.sh
RUN chmod +x /usr/local/bin/helm-launcher.sh
ADD artifacts/helm-launcher.v2.sh /usr/local/bin/helm-launcher.v2.sh
RUN chmod +x /usr/local/bin/helm-launcher.v2.sh
# Copy build scripts
ADD artifacts/quay-push.sh /usr/local/bin/quay-push.sh
RUN chmod +x /usr/local/bin/quay-push.sh
ADD artifacts/quay-push.v2.sh /usr/local/bin/quay-push.v2.sh
RUN chmod +x /usr/local/bin/quay-push.v2.sh
# Copy versioning tool
ADD artifacts/version-tool.sh /usr/local/bin/version-tool.sh
RUN chmod +x /usr/local/bin/version-tool.sh
# Installing AWS CLI
RUN apt-get install python python-pip -y
RUN pip install awscli --upgrade
# Docker Setup
RUN curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
RUN tar -xz -C /tmp -f /tmp/docker-$VER.tgz
RUN mv /tmp/docker/* /usr/bin
# Entrypoint
CMD tail -f /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment