Skip to content

Instantly share code, notes, and snippets.

@bkrannich
Created September 7, 2018 03:31
Show Gist options
  • Save bkrannich/883e0bea4fe1dd2a060dafbf598418c2 to your computer and use it in GitHub Desktop.
Save bkrannich/883e0bea4fe1dd2a060dafbf598418c2 to your computer and use it in GitHub Desktop.
# https://github.com/SUSE/scf/pull/1174
# docker build -t build:latest .
# git clone https://github.com/SUSE/scf
# cd scf && git checkout eirni && cd ..
# docker run -it \
# -v /var/run/docker.sock:/var/run/docker.sock \
# -v "${PWD}/scf":"/scf" \
# build:latest bash
# # inside the container
# direnv allow /scf && cd scf
# git submodule update --init --recursive
# make vagrant-prep
FROM ubuntu:16.04
LABEL MAINTAINER="tbd"
ENV BINPATH="/usr/local/bin" \
GOROOT="/goroot" \
GOPATH="/gopath"
ENV JQ_VERSION="1.5" \
GOLANG_VERSION="1.8" \
KUBECTL_VERSION="v1.7.1" \
HELM_CERTGEN_VERSION="1.0.0"
RUN apt-get update -y && apt-get install -y \
apt-transport-https \
autoconf \
automake \
bison \
build-essential \
bzr \
ca-certificates \
curl \
dnsutils \
git-core \
libc6-dev \
libmysqlclient-dev \
libpq-dev \
libreadline6 \
libreadline6-dev \
libsqlite3-dev \
libssl-dev \
libtool \
libxml2-dev \
libxslt-dev \
libxslt1-dev \
libyaml-dev \
mercurial \
nano \
ncurses-dev \
nginx \
openssh-client \
openssh-server \
openssl \
pkg-config \
ruby \
ruby-dev \
software-properties-common \
sqlite3 \
subversion \
sudo \
zlib1g \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# Install BOSH Cli
RUN gem install bosh_cli --no-ri --no-rdoc
# Install Cloud Foundry command line
RUN curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary&source=github" \
| tar -zx -C /usr/local/bin
# Install latest kubectl
RUN curl -L "https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" -o /usr/local/bin/kubectl \
&& chmod a+x ${BINPATH}/kubectl
# Install jq
RUN curl -L "https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64" -o /usr/local/bin/jq \
&& chmod a+x ${BINPATH}/jq
# Install golang
RUN mkdir ${GOROOT} \
&& mkdir ${GOPATH} \
&& curl https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz \
| tar xvzf - -C ${GOROOT} --strip-components=1
ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin
# Install certstrap
RUN git clone https://github.com/square/certstrap /opt/bcf/certstrap \
&& cd /opt/bcf/certstrap \
&& ./build \
&& cp /opt/bcf/certstrap/bin/certstrap-*-linux-amd64 ${BINPATH}/certstrap
# Install helm
RUN mkdir /opt/bcf/helm \
&& curl -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get -o /opt/bcf/helm/get_helm.sh \
&& chmod +x /opt/bcf/helm/get_helm.sh \
&& /opt/bcf/helm/get_helm.sh \
&& helm init --client-only
# install helm-certgen
RUN mkdir /opt/bcf/helm/helm-certgen \
&& curl -L "https://github.com/SUSE/helm-certgen/releases/download/${HELM_CERTGEN_VERSION}/certgen-linux-amd64-1-0-0-1501794790-f3b21c90.tgz" \
| tar -zx -C /opt/bcf/helm/helm-certgen \
&& helm plugin install /opt/bcf/helm/helm-certgen
# Install fissile
RUN git clone https://github.com/SUSE/fissile $GOPATH/src/github.com/SUSE/fissile \
&& cd $GOPATH/src/github.com/SUSE/fissile \
&& make tools \
&& make build \
&& mv $GOPATH/src/github.com/SUSE/fissile/build/linux-amd64/fissile /usr/local/bin/fissile
# Install stampy
RUN go get -d github.com/SUSE/stampy \
&& cd $GOPATH/src/github.com/SUSE/stampy \
&& make tools \
&& make all \
&& mv $GOPATH/src/github.com/SUSE/stampy/build/linux-amd64/stampy ${BINPATH}/stampy
# Install kctl
RUN go get -d github.com/aarondl/kctl \
&& cd $GOPATH/src/github.com/aarondl/kctl \
&& go build \
&& mv kctl ${BINPATH}/k
# Install docker
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
| sudo apt-key add - && apt-key fingerprint 0EBFCD88 \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install -y docker-ce \
&& rm -rf /var/lib/apt/lists/*
# Install shfmt
RUN go get -u mvdan.cc/sh/cmd/shfmt
# Install direnv
RUN git clone https://github.com/direnv/direnv ${GOPATH}/src/github.com/direnv/direnv \
&& cd ${GOPATH}/src/github.com/direnv/direnv \
&& make install \
&& echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
WORKDIR /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment