Skip to content

Commit

Permalink
Repository cleanup, Kustomize Installation (shopsys#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrHeinz authored Nov 29, 2018
2 parents af4a01d + 94a084e commit 9de1fbb
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 203 deletions.
84 changes: 0 additions & 84 deletions .circleci/config.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.idea
/nbproject
.DS_Store
107 changes: 54 additions & 53 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,69 +1,70 @@
FROM alpine:3.6

LABEL maintainer="[email protected]"

ENV DOCKER_CLIENT_VERSION="18.05.0-ce"
ENV TERRAFORM_VERSION="0.11.7"
ENV HELM_VERSION="2.9.1"
ENV KUBECTL_VERSION="1.11.1"
ENV GOSS_VERSION="0.3.6"
ENV YQ_VERSION="2.1.1"
ENV CLOUD_SDK_VERSION 206.0.0
ENV PATH /tmp/google-cloud-sdk/bin:$PATH
ENV KUSTOMIZE_VERSION="1.0.10"
ENV CLOUD_SDK_VERSION="206.0.0"
ENV PATH /opt/google-cloud-sdk/bin:$PATH

WORKDIR /tmp

# Buildpack-deps basic requirements
# Install dependencies
RUN apk add --update --no-cache \
ca-certificates \
curl \
gnupg \
wget \
tar \
unzip && \
# Install git vcs
apk add --update --no-cache \
git \
openssl \
openssh-client \
bash && \
# Install Docker client, Helm, Terraform, Kubectlx
curl --location https://download.docker.com/linux/static/edge/x86_64/docker-$DOCKER_CLIENT_VERSION.tgz --output /tmp/docker-$DOCKER_CLIENT_VERSION.tgz && \
tar --extract --gzip --directory /tmp --file /tmp/docker-$DOCKER_CLIENT_VERSION.tgz && \
mv /tmp/docker/* /usr/bin && \
rm -rf /tmp/* && \
curl --location https://storage.googleapis.com/kubernetes-helm/helm-v$HELM_VERSION-linux-amd64.tar.gz --output helm.tar.gz && \
tar --extract --file helm.tar.gz && \
mv linux-amd64/helm /usr/bin/helm && \
rm -rf linux-amd64 helm.tar.gz && \
curl --location https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip --output terraform.zip && \
unzip terraform.zip && \
mv terraform /usr/bin/terraform && \
rm -rf terraform.zip && \
curl --location https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl --output /usr/bin/kubectl && \
chmod +x /usr/bin/kubectl && \
curl --location https://github.com/aelsabbahy/goss/releases/download/v$GOSS_VERSION/goss-linux-amd64 --output /usr/local/bin/goss && \
curl --location https://raw.githubusercontent.com/aelsabbahy/goss/v$GOSS_VERSION/extras/dgoss/dgoss --output /usr/local/bin/dgoss && \
chmod +rx /usr/local/bin/goss && \
chmod +rx /usr/local/bin/dgoss && \
wget --output-document=/usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/$YQ_VERSION/yq_linux_amd64 && \
chmod +x /usr/local/bin/yq
bash \
ca-certificates \
curl \
git \
gnupg \
libc6-compat \
openssh-client \
py-crcmod \
python \
tar \
unzip \
wget \
&& rm -rf /var/cache/apk/*

# Install Docker
RUN curl --location https://download.docker.com/linux/static/edge/x86_64/docker-${DOCKER_CLIENT_VERSION}.tgz --output /tmp/docker.tgz && \
tar --extract --gzip --directory /tmp --file /tmp/docker.tgz && \
mv /tmp/docker/* /usr/local/bin && \
docker --version && \
rm -rf /tmp/*

# Install Terraform
RUN curl --location https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip --output terraform.zip && \
unzip terraform.zip && \
mv terraform /usr/local/bin/terraform && \
terraform --version && \
rm -rf /tmp/*

# Install Kubectl
RUN curl --location https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl --output /usr/local/bin/kubectl && \
chmod +x /usr/local/bin/kubectl && \
kubectl version --client -o yaml

# Install yq
RUN curl --location https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 --output /usr/local/bin/yq && \
chmod +x /usr/local/bin/yq && \
yq --version

# Install Kustomize
RUN curl --location https://github.com/kubernetes-sigs/kustomize/releases/download/v${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64 --output /usr/local/bin/kustomize && \
chmod +x /usr/local/bin/kustomize && \
kustomize version

RUN apk --no-cache add \
curl \
python \
py-crcmod \
bash \
libc6-compat \
openssh-client \
git \
&& curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
tar xzf google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
rm google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
# Install Google Cloud SDK
RUN curl --location https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz --output google-cloud-sdk.tar.gz && \
tar xzf google-cloud-sdk.tar.gz && \
mkdir -p /opt/google-cloud-sdk && \
mv google-cloud-sdk/* /opt/google-cloud-sdk && \
ln -s /lib /lib64 && \
gcloud --version && \
gcloud config set core/disable_usage_reporting true && \
gcloud config set component_manager/disable_update_check true && \
gcloud config set metrics/environment github_docker_image && \
gcloud --version
rm -rf /tmp/*

VOLUME ["/root/.config"]
VOLUME ["/root/.config"]
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Kubernetes Build Pack
Kubernetes Build pack serves to build and deploy [Shopsys Framework](https://github.com/shopsys/shopsys) application using Docker, Kubernetes, Terraform etc. that are preinstalled into Dockerfile which can be used later as an image.

## Requirements
Docker

## What it contains
[Docker](https://www.docker.com/)

[Kubernetes - kubectl](https://kubernetes.io/)

[Terraform](https://www.terraform.io/)

[Yq](https://github.com/kislyuk/yq)

[Google Cloud SDK](https://cloud.google.com/sdk/)

[Kustomize](https://github.com/kubernetes-sigs/kustomize)

## How to use
Basic concept of usage of this image is to mount your repository into container volume from which you can perform all your tasks related to deploying Shopsys Framework.

*Code example*:

```
cd /my-project/
docker run \
-v $PWD:/tmp \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.kube/config:/root/.kube/config \
shopsys/kubernetes-buildpack
--rm
<your scripts>
```

## How to extend
What if I want to work with some technology that is not included in shopsys/kubernetes-buildpack?

You can extend our image in `Dockerfile` and install applications and tools that you require.

```Dockerfile
FROM shopsys/kubernetes-buildpack

# install tools you want here, eg. Python
RUN apk add --update --no-cache python3
```
66 changes: 0 additions & 66 deletions goss.yaml

This file was deleted.

0 comments on commit 9de1fbb

Please sign in to comment.