Skip to content
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

[docker] Added fix to run image release on tags creation + backfill action #2118

Merged
merged 4 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/docker-image-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,23 @@ name: docker-image-release
on:
push:
tags:
- "!*-dev"
- "!*-dev*"
- '[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
inputs:
tag:
description: 'tag name'
required: true
default: 'undefined'
type: string

jobs:
docker-image-build-push:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Docker meta
Expand All @@ -23,7 +31,7 @@ jobs:
tags: |
type=semver,pattern={{version}}
flavor: |
latest=true
latest=${{ inputs.tag && true || false }}
- name: Docker meta root
id: metaroot
uses: docker/metadata-action@v5
Expand All @@ -33,7 +41,7 @@ jobs:
tags: |
type=semver,pattern={{version}}
flavor: |
latest=true
latest=${{ inputs.tag && true || false }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
Expand All @@ -46,6 +54,8 @@ jobs:
with:
context: ./internal/devbox/generate/tmpl/
file: ./internal/devbox/generate/tmpl/DevboxImageDockerfile
build-args: |
DEVBOX_USE_VERSION=${{ inputs.tag }}
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
Expand All @@ -54,6 +64,8 @@ jobs:
with:
context: ./internal/devbox/generate/tmpl/
file: ./internal/devbox/generate/tmpl/DevboxImageDockerfileRootUser
build-args: |
DEVBOX_USE_VERSION=${{ inputs.tag }}
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.metaroot.outputs.tags }}
4 changes: 4 additions & 0 deletions internal/devbox/generate/tmpl/DevboxImageDockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM debian:stable-slim

# Optional arg to install custom devbox version
ARG DEVBOX_USE_VERSION

# Step 1: Installing dependencies
RUN apt-get update
RUN apt-get -y install bash binutils git xz-utils wget sudo
Expand All @@ -18,6 +21,7 @@ RUN . ~/.nix-profile/etc/profile.d/nix.sh
ENV PATH="/home/${DEVBOX_USER}/.nix-profile/bin:$PATH"

# Step 3: Installing devbox
ENV DEVBOX_USE_VERSION=$DEVBOX_USE_VERSION
RUN wget --quiet --output-document=/dev/stdout https://get.jetify.com/devbox | bash -s -- -f
RUN chown -R "${DEVBOX_USER}:${DEVBOX_USER}" /usr/local/bin/devbox

Expand Down
4 changes: 4 additions & 0 deletions internal/devbox/generate/tmpl/DevboxImageDockerfileRootUser
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM debian:stable-slim

# Optional arg to install custom devbox version
ARG DEVBOX_USE_VERSION

# Step 1: Installing dependencies
RUN apt-get update
RUN apt-get -y install bash binutils git xz-utils wget sudo
Expand All @@ -12,6 +15,7 @@ RUN . ~/.nix-profile/etc/profile.d/nix.sh
ENV PATH="/root/.nix-profile/bin:$PATH"

# Step 3: Installing devbox
ENV DEVBOX_USE_VERSION=$DEVBOX_USE_VERSION
RUN wget --quiet --output-document=/dev/stdout https://get.jetify.com/devbox | bash -s -- -f

CMD ["devbox", "version"]