Skip to content

Commit

Permalink
disable user optional packages and install hugo (#22)
Browse files Browse the repository at this point in the history
* disable optional extras and add hugo

* disable optional extras and add hugo
  • Loading branch information
usrbinkat authored Nov 16, 2023
1 parent e135352 commit e6e24d1
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 104 deletions.
85 changes: 49 additions & 36 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -221,50 +221,63 @@ RUN set -ex \
&& yarn --version \
&& true
# Install kind (kubernetes-in-docker)
# TODO: relocate install to devcontainer.json
RUN set -ex \
&& export arch=$(uname -m | awk '{ if ($1 == "x86_64") print "amd64"; else if ($1 == "aarch64" || $1 == "arm64") print "arm64"; else print "unknown" }') \
&& export urlKindRelease="https://api.github.com/repos/kubernetes-sigs/kind/releases/latest" \
&& export urlKindVersion=$(curl -s ${urlKindRelease} | awk -F '["v,]' '/tag_name/{print $5}') \
&& export urlKindBase="https://github.com/kubernetes-sigs/kind/releases/download" \
&& export urlKindBin="kind-linux-${arch}" \
&& export urlKind="${urlKindBase}/v${urlKindVersion}/${urlKindBin}" \
&& sudo curl -L ${urlKind} --output /usr/local/bin/kind \
&& sudo chmod +x /usr/local/bin/kind \
&& which kind \
&& kind version \
&& true
# Install kubectl
# TODO: relocate install to devcontainer.json
# Install hugo
EXPOSE 1313
RUN set -ex \
&& export arch=$(uname -m | awk '{ if ($1 == "x86_64") print "amd64"; else if ($1 == "aarch64" || $1 == "arm64") print "arm64"; else print "unknown" }') \
&& export varKubectlVersion="$(curl --silent -L https://storage.googleapis.com/kubernetes-release/release/stable.txt | sed 's/v//g')" \
&& export varKubectlUrl="https://storage.googleapis.com/kubernetes-release/release/v${varKubectlVersion}/bin/linux/${arch}/kubectl" \
&& sudo curl -L ${varKubectlUrl} --output /usr/local/bin/kubectl \
&& sudo chmod +x /usr/local/bin/kubectl \
&& kubectl version --client || true \
&& export urlHugoRelease="https://api.github.com/repos/gohugoio/hugo/releases/latest" \
&& export urlHugoVersion=$(curl -s ${urlHugoRelease} | awk -F '["v,]' '/tag_name/{print $5}') \
&& export urlHugoBase="https://github.com/gohugoio/hugo/releases/download" \
&& export urlHugoBin="hugo_${urlHugoVersion}_linux-${arch}.deb" \
&& export urlHugo="${urlHugoBase}/v${urlHugoVersion}/${urlHugoBin}" \
&& curl --output /tmp/${urlHugoBin} -L ${urlHugo} \
&& sudo dpkg -i /tmp/${urlHugoBin} \
&& which hugo \
&& hugo version \
&& rm -rf /tmp/* \
&& true
# Install helm
# TODO: relocate install to devcontainer.json
RUN set -ex \
&& export varVerHelm="$(curl -s https://api.github.com/repos/helm/helm/releases/latest | awk -F '[\"v,]' '/tag_name/{print $5}')" \
&& export varUrlHelm="https://get.helm.sh/helm-v${varVerHelm}-linux-amd64.tar.gz" \
&& curl -L ${varUrlHelm} | tar xzvf - --directory /tmp linux-amd64/helm \
&& chmod +x /tmp/linux-amd64/helm \
&& sudo mv /tmp/linux-amd64/helm /usr/local/bin/helm \
&& helm version \
&& rm -rf /tmp/linux-amd64 \
&& true
## Install kind (kubernetes-in-docker)
## TODO: relocate install to devcontainer.json
#RUN set -ex \
# && export arch=$(uname -m | awk '{ if ($1 == "x86_64") print "amd64"; else if ($1 == "aarch64" || $1 == "arm64") print "arm64"; else print "unknown" }') \
# && export urlKindRelease="https://api.github.com/repos/kubernetes-sigs/kind/releases/latest" \
# && export urlKindVersion=$(curl -s ${urlKindRelease} | awk -F '["v,]' '/tag_name/{print $5}') \
# && export urlKindBase="https://github.com/kubernetes-sigs/kind/releases/download" \
# && export urlKindBin="kind-linux-${arch}" \
# && export urlKind="${urlKindBase}/v${urlKindVersion}/${urlKindBin}" \
# && sudo curl -L ${urlKind} --output /usr/local/bin/kind \
# && sudo chmod +x /usr/local/bin/kind \
# && which kind \
# && kind version \
# && true
#
## Install kubectl
## TODO: relocate install to devcontainer.json
#RUN set -ex \
# && export arch=$(uname -m | awk '{ if ($1 == "x86_64") print "amd64"; else if ($1 == "aarch64" || $1 == "arm64") print "arm64"; else print "unknown" }') \
# && export varKubectlVersion="$(curl --silent -L https://storage.googleapis.com/kubernetes-release/release/stable.txt | sed 's/v//g')" \
# && export varKubectlUrl="https://storage.googleapis.com/kubernetes-release/release/v${varKubectlVersion}/bin/linux/${arch}/kubectl" \
# && sudo curl -L ${varKubectlUrl} --output /usr/local/bin/kubectl \
# && sudo chmod +x /usr/local/bin/kubectl \
# && kubectl version --client || true \
# && true
#
## Install helm
## TODO: relocate install to devcontainer.json
#RUN set -ex \
# && export varVerHelm="$(curl -s https://api.github.com/repos/helm/helm/releases/latest | awk -F '[\"v,]' '/tag_name/{print $5}')" \
# && export varUrlHelm="https://get.helm.sh/helm-v${varVerHelm}-linux-amd64.tar.gz" \
# && curl -L ${varUrlHelm} | tar xzvf - --directory /tmp linux-amd64/helm \
# && chmod +x /tmp/linux-amd64/helm \
# && sudo mv /tmp/linux-amd64/helm /usr/local/bin/helm \
# && helm version \
# && rm -rf /tmp/linux-amd64 \
# && true
WORKDIR /workspaces
CMD ["/usr/bin/zsh"]
# Hugo Development Web Server Port for pulumi/pulumi-hugo
EXPOSE 1313
# GHCR Labels
LABEL org.opencontainers.image.licenses="APACHE2"
LABEL org.opencontainers.image.source="https://github.com/pulumi/devcontainer"
Expand Down
25 changes: 18 additions & 7 deletions devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
{
"name": "pulumi",
"image": "ghcr.io/pulumi/devcontainer",
"settings": {
"terminal.integrated.shell.linux": "/usr/bin/zsh"
},
"customizations": {
"vscode": {
"settings": [
Expand All @@ -23,6 +20,7 @@
"editor.gotoLocation.multipleDeclarations", "goto",
"editor.gotoLocation.multipleImplementations", "goto",
"editor.gotoLocation.multipleTypeDefinitions", "goto",
"terminal.integrated.shell.linux": "/usr/bin/zsh",
"files.trimTrailingWhitespace", true,
"files.trimFinalNewlines", true
],
Expand All @@ -44,14 +42,27 @@
}
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"installOhMyZshConfig": true,
"upgradePackages": true,
"nonFreePackages": true,
"username": "vscode",
"userUid": "automatic",
"userGid": "automatic"
},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"version": "latest",
"installDockerBuildx": true,
"moby": false
"moby": false,
"installDockerBuildx": true,
"version": "latest",
"dockerDashComposeVersion": "v2"
}
},
"postCreateCommand": "git submodule update --init --recursive",
"remoteUser": "vscode",
"forwardPorts": [1313],
"runArgs": ["--network=host"]
}

61 changes: 0 additions & 61 deletions team-docs/devcontainer.json

This file was deleted.

0 comments on commit e6e24d1

Please sign in to comment.