forked from shopsys/kubernetes-buildpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repository cleanup, Kustomize Installation (shopsys#1)
- Loading branch information
Showing
5 changed files
with
104 additions
and
203 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/.idea | ||
/nbproject | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |