Skip to content

Commit

Permalink
merge from \master\
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Mar 13, 2023
2 parents 6475c8a + e2f1a6c commit a5f1d00
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 74 deletions.
39 changes: 26 additions & 13 deletions images/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

FROM ubuntu:jammy
FROM ubuntu:22.10

# Set the shell to Bash
SHELL ["/bin/bash", "-c"]
Expand All @@ -36,7 +36,7 @@ RUN apt update && \
apt upgrade -y && \
apt install -y sudo git curl neofetch git-lfs ca-certificates \
unzip zip bash vim nano python3 python3-pip libarchive-tools gnupg lsb-release pkg-config \
libssl-dev
libssl-dev tree htop

# Setup the user environment
RUN groupadd -g ${USER_GID} ${USERNAME} && \
Expand All @@ -58,28 +58,38 @@ RUN apt update && apt install -y docker-ce docker-ce-cli containerd.io docker-co
RUN usermod -aG docker ${USERNAME}

# stuff here
ENV GITHUB_CLI_VERSION="2.23.0"
ENV CODER_CLI_VERSION="0.17.1"
ENV TERRAFORM_VERSION="1.3.8"
ENV KUBECTL_VERSION="1.26.1"
ENV HELM_VERSION="3.11.1"
ENV BAZEL_BUILDTOOLS_VERSION="6.0.1"
ENV GITHUB_CLI_VERSION="2.24.3"
ENV CODER_CLI_VERSION="0.19.2"
ENV TERRAFORM_VERSION="1.4.0"
ENV BAZELISK_VERSION="1.16.0"
ENV KUBECTL_VERSION="1.26.2"
ENV HELM_VERSION="3.11.2"

# Get current architecture and download software here
# also this looks like shit, i know!
RUN set -eux; \
arch="$(dpkg --print-architecture)"; \
case "${arch}" in \
aarch64|arm64) \
BAZEL_UNUSED_DEPS_DOWNLOAD_URL="https://github.com/bazelbuild/buildtools/releases/download/${BAZEL_BUILDTOOLS_VERSION}/unused_deps-linux-arm64"; \
BAZEL_BUILDIFIER_DOWNLOAD_URL="https://github.com/bazelbuild/buildtools/releases/download/${BAZEL_BUILDTOOLS_VERSION}/buildifier-linux-arm64"; \
BAZEL_BUILDOZER_DOWNLOAD_URL="https://github.com/bazelbuild/buildtools/releases/download/${BAZEL_BUILDTOOLS_VERSION}/buildifier-linux-arm64"; \
GITHUB_CLI_DOWNLOAD_URL="https://github.com/cli/cli/releases/download/v${GITHUB_CLI_VERSION}/gh_${GITHUB_CLI_VERSION}_linux_arm64.tar.gz"; \
TERRAFORM_DOWNLOAD_URL="https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_arm64.zip"; \
CODER_DOWNLOAD_URL="https://github.com/coder/coder/releases/download/v${CODER_CLI_VERSION}/coder_${CODER_CLI_VERSION}_linux_arm64.tar.gz"; \
BAZELISK_DOWNLOAD_URL="https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VERSION}/bazelisk-linux-arm64"; \
KUBECTL_DOWNLOAD_URL="https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/arm64/kubectl"; \
CODER_DOWNLOAD_URL="https://github.com/coder/coder/releases/download/v${CODER_CLI_VERSION}/coder_${CODER_CLI_VERSION}_linux_arm64.tar.gz"; \
HELM_DOWNLOAD_URL="https://get.helm.sh/helm-v${HELM_VERSION}-linux-arm64.tar.gz"; \
;; \
amd64|x86_64) \
BAZEL_UNUSED_DEPS_DOWNLOAD_URL="https://github.com/bazelbuild/buildtools/releases/download/${BAZEL_BUILDTOOLS_VERSION}/unused_deps-linux-amd64"; \
BAZEL_BUILDIFIER_DOWNLOAD_URL="https://github.com/bazelbuild/buildtools/releases/download/${BAZEL_BUILDTOOLS_VERSION}/buildifier-linux-amd64"; \
BAZEL_BUILDOZER_DOWNLOAD_URL="https://github.com/bazelbuild/buildtools/releases/download/${BAZEL_BUILDTOOLS_VERSION}/buildifier-linux-amd64"; \
GITHUB_CLI_DOWNLOAD_URL="https://github.com/cli/cli/releases/download/v${GITHUB_CLI_VERSION}/gh_${GITHUB_CLI_VERSION}_linux_amd64.tar.gz" \
CODER_DOWNLOAD_URL="https://github.com/coder/coder/releases/download/v${CODER_CLI_VERSION}/coder_${CODER_CLI_VERSION}_linux_amd64.tar.gz" \
TERRAFORM_DOWNLOAD_URL="https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" \
BAZELISK_DOWNLOAD_URL="https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VERSION}/bazelisk-linux-amd64"; \
CODER_DOWNLOAD_URL="https://github.com/coder/coder/releases/download/v${CODER_CLI_VERSION}/coder_${CODER_CLI_VERSION}_linux_amd64.tar.gz" \
KUBECTL_DOWNLOAD_URL="https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl"; \
HELM_DOWNLOAD_URL="https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz"; \
;; \
Expand All @@ -89,17 +99,20 @@ RUN set -eux; \
curl -L ${CODER_DOWNLOAD_URL} | tar xfz - -C /opt/coder/cli --strip-components=1; \
curl -L ${GITHUB_CLI_DOWNLOAD_URL} | tar xfz - -C /opt/github/cli --strip-components=1; \
curl -L ${HELM_DOWNLOAD_URL} | tar xfz - -C /opt/helm --strip-components=1; \
curl -L ${TERRAFORM_DOWNLOAD_URL} | bsdtar xfz - --strip-components=1 -C /opt/hashicorp/terraform;
curl -L ${TERRAFORM_DOWNLOAD_URL} | bsdtar xfz - --strip-components=1 -C /opt/hashicorp/terraform; \
curl -fsSL -o /usr/local/bin/bazel ${BAZELISK_DOWNLOAD_URL}; \
curl -fsSL -o /usr/local/bin/bazel-buildifier ${BAZEL_BUILDIFIER_DOWNLOAD_URL}; \
curl -fsSL -o /usr/local/bin/bazel-buildozer ${BAZEL_BUILDOZER_DOWNLOAD_URL}; \
curl -fsSL -o /usr/local/bin/bazel-unused-deps ${BAZEL_UNUSED_DEPS_DOWNLOAD_URL};

# Let the user execute `kubectl`
RUN chmod +x /usr/local/bin/kubectl
# Let the user execute `kubectl` and `bazel` (which is just Bazelisk so we don't have to have a Java environment in this image)
RUN chmod +x /usr/local/bin/kubectl /usr/local/bin/bazel /usr/local/bin/bazel-*

# Set back to our user!
USER ${USERNAME}
WORKDIR /home/${USERNAME}

ENV PATH=$PATH:/opt/coder/cli:/opt/hashicorp/terraform:/opt/helm:/opt/github/cli/bin:/home/${USERNAME}/.local/bin
ENV LANG=en-GB.UTF-8

# Add common Helm repositores
RUN helm repo add bitnami https://charts.bitnami.com/bitnami
30 changes: 18 additions & 12 deletions images/base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
This image is the main base for all of the images in this repository.

## Bundled Software
| Name | Description | Version |
| ----------- | --------------------------------------------------------------------------------- | --------------------- |
| GitHub CLI | GitHub's official command line utility | [v2.23.0][github-cli] |
| Coder (OSS) | Remote development environments on your infrastructure provisioned with Terraform | [v0.17.1][coder] |
| Terraform | Automate Infrastructure on Any Cloud | [v1.3.8][terraform] |
| `kubectl` | kubectl controls the Kubernetes cluster manager. | [v1.26.1][kubectl] |
| `helm` | The Kubernetes Package Manager | [v3.11.1][helm] |
| Name | Description | Version |
| ---------------- | --------------------------------------------------------------------------------- | -------------------------- |
| Bazel Buildtools | A bazel BUILD file formatter and editor | [v6.0.1][bazel-buildtools] |
| GitHub CLI | GitHub's official command line utility | [v2.24.3][github-cli] |
| Coder (OSS) | Remote development environments on your infrastructure provisioned with Terraform | [v0.19.2][coder] |
| Terraform | Automate Infrastructure on Any Cloud | [v1.4.0][terraform] |
| Bazelisk | A user-friendly launcher for Bazel. | [v1.16.0][bazelisk] |
| `kubectl` | kubectl controls the Kubernetes cluster manager. | [v1.26.2][kubectl] |
| `bazel` | a fast, scalable, multi-language and extensible build system | [v6.1.0][bazel] |
| `helm` | The Kubernetes Package Manager | [v3.11.2][helm] |

[github-cli]: https://github.com/cli/cli/releases/tag/v2.23.0
[terraform]: https://github.com/hashicorp/terraform/releases/tag/v1.3.8
[kubectl]: https://github.com/kubernetes/kubernetes/releases/tag/v1.26.1
[coder]: https://github.com/coder/coder/releases/tag/v0.17.1
[helm]: https://github.com/helm/helm/releases/tag/v3.11.1
[bazel-buildtools]: https://github.com/bazelbuild/buildtools/releases/tag/6.0.1
[github-cli]: https://github.com/cli/cli/releases/tag/v2.24.3
[terraform]: https://github.com/hashicorp/terraform/releases/tag/v1.4.0
[bazelisk]: https://github.com/bazelbuild/bazelisk/releases/tag/v1.16.0
[kubectl]: https://github.com/kubernetes/kubernetes/releases/tag/v1.26.2
[coder]: https://github.com/coder/coder/releases/tag/v0.19.2
[bazel]: https://github.com/bazelbuild/bazel/releases/tag/6.1.0
[helm]: https://github.com/helm/helm/releases/tag/v3.11.2

### Helm
Helm comes with Bitnami's charts library preconfigured.
6 changes: 3 additions & 3 deletions images/dotnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
FROM ghcr.io/auguwu/coder-images/base

ENV USERNAME=noel
ENV DOTNET_VERSION=7.0.102
ENV DOTNET_VERSION=7.0.201
ENV DEBIAN_FRONTEND=noninteractive
ENV X64_PR="c646b288-5d5b-4c9c-a95b-e1fad1c0d95d/e13d71d48b629fe3a85f5676deb09e2d"
ENV ARM_PR="72ec0dc2-f425-48c3-97f1-dc83740ba400/78e8fa01fa9987834fa01c19a23dd2e7"
ENV X64_PR="ec76d8ee-8776-42ce-b158-f723a221fc56/0baa1089edf0e0674d719f6a5d847b75"
ENV ARM_PR="35901872-1f00-48e4-9f55-e6c79823e7fd/8af43bb5e25d090c0af921974287ac2c"

USER root

Expand Down
4 changes: 2 additions & 2 deletions images/dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ This image extends from the [base image](https://github.com/auguwu/coder-images/
## Bundled Software
| Name | Description | Version |
| -------- | ---------------------------------------------------------- | ---------------------- |
| .NET SDK | Free. Cross-platform. Open source. Build any app with .NET | [v7.0.102][dotnet-sdk] |
| .NET SDK | Free. Cross-platform. Open source. Build any app with .NET | [v7.0.103][dotnet-sdk] |

[dotnet-sdk]: https://github.com/dotnet/sdk/releases/tag/v7.0.102
[dotnet-sdk]: https://github.com/dotnet/sdk/releases/tag/v7.0.103
6 changes: 3 additions & 3 deletions images/golang/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ ENV USERNAME=noel
USER root

# Put versions in environment variables
ENV GOLANG_VERSION="1.20"
ENV GORELEASER_VERSION="1.15.2"
ENV GOLANGCI_VERSION="1.51.1"
ENV GOLANG_VERSION="1.20.2"
ENV GORELEASER_VERSION="1.16.1"
ENV GOLANGCI_VERSION="1.51.2"

# Install packages here.
RUN set -eux; \
Expand Down
12 changes: 6 additions & 6 deletions images/golang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ This is the Docker image that bundles the Go compiler with **goreleaser** and **
## Bundled Software
| Name | Description | Version |
| ---------- | -------------------------------------------------- | --------------------- |
| Go | The Go programming language | [v1.20][golang] |
| GoReleaser | Deliver Go binaries as fast and easily as possible | [v1.15.2][goreleaser] |
| Golang CI | Fast linters Runner for Go | [v1.51.1][golangci] |
| Go | The Go programming language | [v1.20.2][golang] |
| GoReleaser | Deliver Go binaries as fast and easily as possible | [v1.16.1][goreleaser] |
| Golang CI | Fast linters Runner for Go | [v1.51.2][golangci] |

[goreleaser]: https://github.com/goreleaser/goreleaser/releases/tag/v1.15.2
[golangci]: https://github.com/golangci/golangci-lint/releases/tag/v1.51.1
[golang]: https://github.com/golang/go/releases/tag/go1.20
[goreleaser]: https://github.com/goreleaser/goreleaser/releases/tag/v1.16.1
[golangci]: https://github.com/golangci/golangci-lint/releases/tag/v1.51.2
[golang]: https://github.com/golang/go/releases/tag/go1.20.2
4 changes: 2 additions & 2 deletions images/java/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ ENV USERNAME=noel
USER root

# Set version environment variables
ENV GRADLE_VERSION="8.0"
ENV MAVEN_VERSION="3.8.7"
ENV GRADLE_VERSION="8.0.2"
ENV MAVEN_VERSION="3.9.0"

# install required things
RUN DEBIAN_FRONTEND="noninteractive" apt install -y wget libarchive-tools
Expand Down
8 changes: 4 additions & 4 deletions images/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ This image extends the [base image](https://github.com/auguwu/coder-images/pkgs/
| Name | Description | Version |
| ------ | --------------------------------------------------- | -----------------------------|
| JDK | The Java development kit. | [19.0.2+7][temurin-release] |
| Gradle | Adaptable, fast automation for all | [v8.0][gradle-release] |
| Maven | Software project management and comprehension tool. | [v3.8.7][maven-release] |
| Gradle | Adaptable, fast automation for all | [v8.0.2][gradle-release] |
| Maven | Software project management and comprehension tool. | [v3.9.0][maven-release] |

[temurin-release]: https://github.com/adoptium/temurin19-binaries/releases/tag/jdk-19.0.2%2B7
[gradle-release]: https://github.com/gradle/gradle/releases/tag/v8.0.0
[maven-release]: https://github.com/apache/maven/releases/tag/maven-3.8.7
[gradle-release]: https://github.com/gradle/gradle/releases/tag/v8.0.2
[maven-release]: https://github.com/apache/maven/releases/tag/maven-3.9.0
2 changes: 1 addition & 1 deletion images/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ENV USERNAME=noel
USER root

# versions here
ENV NODE_VERSION="19.6.0"
ENV NODE_VERSION="19.7.0"

# Install xz-utils so we can unpack the Node.js installation
RUN DEBIAN_FRONTEND="noninteractive" apt install -y xz-utils
Expand Down
4 changes: 2 additions & 2 deletions images/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ This image extends from the [base image](https://github.com/auguwu/coder-images/
## Bundled Software
| Name | Description | Version |
| ------- | ----------------------------------- | ---------------- |
| Node.js | Node.js JavaScript runtime ✨🐢🚀✨ | [v19.6.0][node] |
| Node.js | Node.js JavaScript runtime ✨🐢🚀✨ | [v19.7.0][node] |

[node]: https://github.com/nodejs/node/releases/v19.6.0
[node]: https://github.com/nodejs/node/releases/v19.7.0
4 changes: 2 additions & 2 deletions images/rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ ENV USERNAME=noel
USER root

# rust version to install
ENV RUSTUP_VERSION="1.25.1"
ENV RUST_VERSION="1.67.1"
ENV RUSTUP_VERSION="1.25.2"
ENV RUST_VERSION="1.68.0"

# Install the Rust (minimal) toolchain
RUN apt install -y --no-install-recommends ca-certificates gcc libc6-dev
Expand Down
2 changes: 1 addition & 1 deletion images/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ This image extends the [base image](https://github.com/auguwu/coder-images/pkgs/
| ---- | ------------------------------------------------------------- | --------------- |
| Rust | Empowering everyone to build reliable and efficient software. | [v1.67.1][rust] |

[rust]: https://github.com/rust-lang/rust/releases/tag/1.67.1
[rust]: https://github.com/rust-lang/rust/releases/tag/1.68.0
32 changes: 16 additions & 16 deletions template/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion template/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ terraform {
required_providers {
coder = {
source = "coder/coder"
version = "0.6.12"
version = "0.6.17"
}

docker = {
Expand Down Expand Up @@ -58,6 +58,11 @@ resource "coder_agent" "main" {
# Fix folder permissions since root owns /home/noel for some reason???
sudo chown -R noel:noel /home/noel
# Run Docker in the background
if command -v dockerd &> /dev/null; then
sudo dockerd &
fi
# Install code-server if enabled
${var.install_codeserver == true ? "curl -fsSL https://code-server.dev/install.sh | sh" : ""}
${var.install_codeserver == true ? "code-server --auth none --port 3621" : ""}
Expand Down Expand Up @@ -121,6 +126,7 @@ resource "docker_container" "workspace" {
}

command = ["/bin/bash", "-c", coder_agent.main.init_script]
runtime = "sysbox-runc"
image = var.custom_image != "" ? var.custom_image : "ghcr.io/auguwu/coder-images/${var.base_image}:latest"
name = data.coder_workspace.me.name
}
6 changes: 0 additions & 6 deletions template/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

variable "enable_dind" {
description = "If the template should initialize a sidecar container for Docker in Docker usage. Don't enable this if the host can't run privileged containers."
default = false
type = bool
}

variable "workspace_dir" {
description = "The directory of where your workspace should be cloned."
default = "/home/noel/workspace"
Expand Down

0 comments on commit a5f1d00

Please sign in to comment.