Skip to content

Commit

Permalink
Add Bun Docker image and update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Jun 27, 2023
1 parent a7f20b7 commit 8295d45
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 15 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,24 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Grab version info
id: tag
run: |
REF=${GITHUB_REF##refs/tags/}
echo "::set-output name=version::$REF"
run: echo "version=${GITHUB_REF##refs/tags/}" >> $GITHUB_OUTPUT

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
with:
# https://github.com/docker/build-push-action/issues/761
driver-opts:
image=moby/buildkit:v0.10.6

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Login into ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: auguwu
password: ${{secrets.GITHUB_TOKEN}}

- name: Build and push!
uses: docker/build-push-action@v4
with:
Expand All @@ -68,29 +67,28 @@ jobs:
needs: [base-image]
strategy:
matrix:
image: [node, rust, java, golang, dotnet]
image: [node, rust, java, golang, dotnet, bun]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Grab version info
id: tag
run: |
REF=${GITHUB_REF##refs/tags/}
echo "::set-output name=version::$REF"
run: echo "version=${GITHUB_REF##refs/tags/}" >> $GITHUB_OUTPUT

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
with:
# https://github.com/docker/build-push-action/issues/761
driver-opts:
image=moby/buildkit:v0.10.6

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Login into ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: auguwu
password: ${{secrets.GITHUB_TOKEN}}

- name: Build and push!
uses: docker/build-push-action@v4
with:
Expand Down
45 changes: 45 additions & 0 deletions images/bun/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 💐💚 coder-images: Optimized, and easy Docker images and Coder templates to use in your everyday work!
# Copyright (c) 2022-2023 Noel Towa <cutie@floofy.dev>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

FROM ghcr.io/auguwu/coder-images/base

ENV USERNAME=noel
USER root
ENV BUN_VERSION="0.6.10"

RUN set -eux; \
arch="$(dpkg --print-architecture)"; \
case "${arch}" in \
aarch64|arm64) \
BUN_DOWNLOAD_URL="https://github.com/oven-sh/bun/releases/download/bun-v${BUN_VERSION}/bun-linux-aarch64.zip"; \
;; \
amd64|x86_64) \
BUN_DOWNLOAD_URL="https://github.com/oven-sh/bun/releases/download/bun-v${BUN_VERSION}/bun-linux-x64.zip"; \
;; \
esac; \
mkdir -p /opt/oven/bun; \
curl -L "${BUN_DOWNLOAD_URL}" | bsdtar xf - --strip-components=1 -C /opt/oven/bun; \
chmod +x /opt/oven/bun/bun

ENV PATH=$PATH:/opt/oven/bun
USER ${USERNAME}

ENV PATH=$PATH:/opt/oven/bun
9 changes: 9 additions & 0 deletions images/bun/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ghcr.io/auguwu/coder-images/bun
This image extends from the [base image](https://github.com/auguwu/coder-images/pkgs/container/coder-images%2Fbase) that includes [Bun](https://bun.sh) to develop from.

## Bundled Software
| Name | Description | Version |
| ----- | ------------------------------------------------------------------------------------------ | -------------- |
| `bun` | Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one | [v0.6.10][bun] |

[bun]: https://github.com/oven-sh/bun/releases/tag/bun-v0.6.10

0 comments on commit 8295d45

Please sign in to comment.