Skip to content

Commit 6a3e6e8

Browse files
committed
feat(devbox): Build image
# Issue To switch over our CI workflows to devbox a docker image is required. # Fix Build it from the Dockerfile generated with `devbox generate dockerfile`
1 parent ccf1198 commit 6a3e6e8

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/image.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,40 @@ env:
1818
IMAGE_NAME: ${{ github.repository }}
1919

2020
jobs:
21+
build-and-push-devbox-image:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
packages: write
26+
name: Build and Push app-autoscaler-release-devbox
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Log in to the Container registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ${{ env.REGISTRY }}
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Extract metadata (tags, labels) for Docker
39+
id: meta
40+
uses: docker/metadata-action@v5
41+
with:
42+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-devbox
43+
44+
- name: Build and push
45+
id: build-and-push
46+
uses: docker/build-push-action@v5
47+
with:
48+
context: .
49+
file: ci/dockerfiles/autoscaler-devbox/Dockerfile
50+
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
51+
tags: ${{ steps.meta.outputs.tags }}
52+
labels: ${{ steps.meta.outputs.labels }}
53+
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-devbox:main
54+
2155
build-and-push-image:
2256
runs-on: ubuntu-latest
2357
permissions:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM jetpackio/devbox@sha256:430afb5a5c9b4ec9f56776e8fcb82fe67fa5fabba3ba67ebb1c13b17d0e8de8d
2+
3+
4+
# Installing your devbox project
5+
WORKDIR /code
6+
USER root:root
7+
RUN mkdir -p /code && chown "${DEVBOX_USER}:${DEVBOX_USER}" /code
8+
USER ${DEVBOX_USER}:${DEVBOX_USER}
9+
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
10+
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock
11+
12+
13+
# Step 6: Copying local flakes directories
14+
COPY local-flake local-flake
15+
16+
RUN devbox run -- echo "Installed Packages."
17+
18+
CMD ["devbox", "shell"]

0 commit comments

Comments
 (0)