-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update alpine image | added debian image #15
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
.vscode | ||
.vscode | ||
.env | ||
.DS_Store |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,15 @@ FROM python:3.8-alpine3.12 as k8s_build | |
ARG KOPS_VERSION | ||
ARG HELM_VERSION | ||
RUN \ | ||
mkdir /main && \ | ||
set -x; > /etc/inittab && mkdir /main && \ | ||
apk update && \ | ||
# export functions, for download, json parsing, ssh keygen, api keygen | ||
apk add --no-cache bash curl jq openssh openssl && \ | ||
apk add --no-cache bash curl jq openssh openssl util-linux bind-tools && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see bind-tools useful for using |
||
# for aws cli, yaml parsing | ||
pip install awscli --upgrade --user --no-cache-dir && \ | ||
# YQ (last verified was 3.4.0) | ||
curl -L $(echo "https://github.com/mikefarah/yq/releases/download/\ | ||
$(curl https://api.github.com/repos/mikefarah/yq/releases/latest | jq -r '.tag_name')/\ | ||
yq_linux_amd64" | tr -d '\n' | tr -d '\t') -o /usr/local/bin/yq && \ | ||
# YQ (v4 needs migration) | ||
curl -L "https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64" \ | ||
-o /usr/local/bin/yq && \ | ||
chmod +x /usr/local/bin/yq && \ | ||
# KOPS | ||
curl -L $(echo "https://github.com/kubernetes/kops/releases/download/${KOPS_VERSION}\ | ||
|
@@ -54,4 +53,4 @@ ENV PATH "/root/.local/bin:$PATH" | |
WORKDIR /main | ||
VOLUME /main | ||
SHELL ["/bin/bash", "-lc"] | ||
CMD ["/bin/bash"] | ||
CMD ["/bin/bash"] |
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,18 +1,16 @@ | ||||||||||||
version: '2.4' | ||||||||||||
services: | ||||||||||||
app: | ||||||||||||
build: # Uncomment to enable local build | ||||||||||||
build: | ||||||||||||
# Uncomment to enable local build | ||||||||||||
context: ../.. | ||||||||||||
dockerfile: ./dist/alpine/Dockerfile | ||||||||||||
args: | ||||||||||||
- KOPS_VERSION | ||||||||||||
- HELM_VERSION | ||||||||||||
image: vathes/k8s-admin:kops${KOPS_VERSION}-helm${HELM_VERSION}-alpine | ||||||||||||
command: | ||||||||||||
image: registry.vathes.com/vathes/k8s-admin:kops${KOPS_VERSION}-helm${HELM_VERSION}-alpine | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this image is public we published it to Docker Hub. We technically could get away with free storage on this one. 😅 |
||||||||||||
command: | ||||||||||||
- bash | ||||||||||||
- -c | ||||||||||||
- > | ||||||||||||
echo "$$0 running..."; | ||||||||||||
echo "PATH: '$$PATH'"; | ||||||||||||
tail -f /dev/null; | ||||||||||||
|
||||||||||||
echo "$$0 running..."; echo "PATH: '$$PATH'"; tail -f /dev/null; | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
FROM python:3.8-bullseye as k8s_build | ||
ARG KOPS_VERSION | ||
ARG HELM_VERSION | ||
RUN \ | ||
set -x; > /etc/inittab && mkdir /main && \ | ||
apt update && \ | ||
# export functions, for download, json parsing, ssh keygen, api keygen | ||
apt add --no-cache bash curl jq openssh openssl util-linux bind-tools && \ | ||
# for aws cli, yaml parsing | ||
pip install awscli --upgrade --user --no-cache-dir && \ | ||
# YQ (v4 needs migration) | ||
curl -L "https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64" \ | ||
-o /usr/local/bin/yq && \ | ||
chmod +x /usr/local/bin/yq && \ | ||
# KOPS | ||
curl -L $(echo "https://github.com/kubernetes/kops/releases/download/${KOPS_VERSION}\ | ||
/kops-linux-amd64" | tr -d '\n' | tr -d '\t') -o /usr/local/bin/kops && \ | ||
chmod +x /usr/local/bin/kops && \ | ||
# KUBECTL | ||
mkdir ${HOME}/.kube && \ | ||
curl -L $(echo "https://storage.googleapis.com/kubernetes-release/release/\ | ||
$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)\ | ||
/bin/linux/amd64/kubectl" | tr -d '\n' | tr -d '\t') -o /usr/local/bin/kubectl && \ | ||
chmod +x /usr/local/bin/kubectl && \ | ||
# HELM | ||
curl -L https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz \ | ||
-o /tmp/helm.tar.gz && \ | ||
tar -zxvf /tmp/helm.tar.gz --strip-components=1 -C /usr/local/bin/ linux-amd64/helm && \ | ||
rm /tmp/helm.tar.gz && \ | ||
chmod +x /usr/local/bin/helm && \ | ||
[ ! "${HELM_VERSION}" == "v2.14.1" ] || helm init --history-max 200 --client-only && \ | ||
[ ! "${HELM_VERSION}" == "v3.3.0" ] || helm repo add stable \ | ||
https://kubernetes-charts.storage.googleapis.com/ && \ | ||
## ------- OPTIONAL ------- | ||
# AWS IAM AUTHENTICATOR CLIENT | ||
curl -L $(echo "https://github.com/kubernetes-sigs/aws-iam-authenticator/releases\ | ||
/download/v0.5.1/aws-iam-authenticator_0.5.1_linux_amd64" | tr -d '\n' | tr -d '\t') \ | ||
-o /usr/local/bin/aws-iam-authenticator && \ | ||
chmod +x /usr/local/bin/aws-iam-authenticator && \ | ||
# BASH Shell Prompt | ||
echo "export PATH=/root/.local/bin:${PATH}" > /etc/profile.d/env.sh && \ | ||
echo $(echo 'export PS1="\[\e[32;1m\]\u\[\e[m\]@\[\e[34;1m\]\H\[\e[m\]:\ | ||
\[\e[33;1m\]\w\[\e[m\]$ "' | tr -d '\n' | tr -d '\t') > /root/.bashrc | ||
ENV PATH "/root/.local/bin:$PATH" | ||
|
||
# #Squashed Final Image | ||
FROM scratch | ||
COPY --from=k8s_build / / | ||
LABEL maintainerName="Raphael Guzman" \ | ||
maintainerEmail="[email protected]" \ | ||
maintainerCompany="DataJoint" | ||
ENV PATH "/root/.local/bin:$PATH" | ||
WORKDIR /main | ||
VOLUME /main | ||
SHELL ["/bin/bash", "-lc"] | ||
CMD ["/bin/bash"] |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,16 @@ | ||||||||||||||||||||||||||||||
version: '2.4' | ||||||||||||||||||||||||||||||
services: | ||||||||||||||||||||||||||||||
app: | ||||||||||||||||||||||||||||||
build: | ||||||||||||||||||||||||||||||
# Uncomment to enable local build | ||||||||||||||||||||||||||||||
context: ../.. | ||||||||||||||||||||||||||||||
dockerfile: ./dist/alpine/Dockerfile | ||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||
args: | ||||||||||||||||||||||||||||||
- KOPS_VERSION | ||||||||||||||||||||||||||||||
- HELM_VERSION | ||||||||||||||||||||||||||||||
image: registry.vathes.com/vathes/k8s-admin:kops${KOPS_VERSION}-helm${HELM_VERSION}-debian | ||||||||||||||||||||||||||||||
command: | ||||||||||||||||||||||||||||||
- bash | ||||||||||||||||||||||||||||||
- -c | ||||||||||||||||||||||||||||||
- > | ||||||||||||||||||||||||||||||
echo "$$0 running..."; echo "PATH: '$$PATH'"; tail -f /dev/null; | ||||||||||||||||||||||||||||||
Comment on lines
+11
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set -x
can be useful to display the actual command that is running. A bit unclear on what is the purpose for removing/etc/inittab
though. 🤔