Skip to content

Commit 21495de

Browse files
committed
devcontainer(just): replace INSTALL_ALL with JUST_RECIPE build arg
- Dockerfile: switch ARG from INSTALL_ALL to JUST_RECIPE and run the specified just recipe during build when JUST_RECIPE is set. - Justfile: update docker/macos "build-all" targets to pass JUST_RECIPE=install-all. - DevContainer configs: update example build args in .devcontainer/*/devcontainer.json to show JUST_RECIPE. - CI/docs: update GitHub Actions input description and docs/build.md / .devcontainer/just/README.md to reference JUST_RECIPE. Allows running arbitrary just recipes at image build time (e.g. install-all) instead of a boolean INSTALL_ALL flag. Signed-off-by: Aaron Wislang <[email protected]>
1 parent d8a248e commit 21495de

File tree

7 files changed

+18
-15
lines changed

7 files changed

+18
-15
lines changed

.devcontainer/just-all/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// "build": {
55
// "dockerfile": "../just/Dockerfile",
66
// "args": {
7-
// "INSTALL_ALL": "true"
7+
// "JUST_RECIPE": "install-all"
88
// }
99
// },
1010
"features": {},

.devcontainer/just/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu
33

44
ARG TARGETARCH
55
ARG GO_VERSION=1.25.1
6-
ARG INSTALL_ALL=false
6+
ARG JUST_RECIPE=""
77

88
ENV TARGETARCH=${TARGETARCH}
99
ENV GO_VERSION=${GO_VERSION}
@@ -30,12 +30,15 @@ RUN mkdir -p ${CARGO_HOME} /home/vscode/.rustup /home/vscode/.npm-global \
3030

3131
WORKDIR /workspace
3232
COPY Justfile ./
33+
COPY Justfile /home/vscode/Justfile
3334
COPY .devcontainer/just/mcp.json /opt/wassette/mcp.json
3435

35-
# Optionally install all components during build
36-
RUN if [ "${INSTALL_ALL}" = "true" ]; then \
36+
# Optionally run a just recipe during build (e.g., install-all)
37+
RUN if [ -n "${JUST_RECIPE}" ]; then \
3738
echo "Building for TARGETARCH=${TARGETARCH}" && \
38-
just install-all; \
39+
echo "Running just recipe: ${JUST_RECIPE}" && \
40+
just ${JUST_RECIPE} && \
41+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
3942
fi
4043

4144
CMD ["just", "--list"]

.devcontainer/just/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ The repository includes a GitHub Actions workflow for building devcontainer imag
301301
4. Configure the build:
302302
- **DevContainer to build**: Select `just`
303303
- **Image tag**: Specify the tag (e.g., `latest`, `all`, `v1.0.0`)
304-
- **Build arguments**: Optional build arguments (comma-separated, e.g., `INSTALL_ALL=true,GO_VERSION=1.24.0`)
304+
- **Build arguments**: Optional build arguments (comma-separated, e.g., `JUST_RECIPE=install-all,GO_VERSION=1.24.0`)
305305

306306
### Build Examples
307307

@@ -317,21 +317,21 @@ Result: `ghcr.io/owner/repo/just:latest`
317317
```
318318
DevContainer: just
319319
Image tag: all
320-
Build arguments: INSTALL_ALL=true
320+
Build arguments: JUST_RECIPE=install-all
321321
```
322322
Result: `ghcr.io/owner/repo/just:all`
323323

324324
**Custom configuration:**
325325
```
326326
DevContainer: just
327327
Image tag: go1.24-full
328-
Build arguments: INSTALL_ALL=true,GO_VERSION=1.24.0,TARGETARCH=arm64
328+
Build arguments: JUST_RECIPE=install-all,GO_VERSION=1.24.0,TARGETARCH=arm64
329329
```
330330
Result: `ghcr.io/owner/repo/just:go1.24-full` with Go 1.24.0 and all components
331331

332332
### Available Build Arguments
333333

334-
- `INSTALL_ALL` - Set to `true` to install all components during build (default: `false`)
334+
- `JUST_RECIPE` - Just recipe to run during build (e.g., `install-all` to install all components, default: empty)
335335
- `GO_VERSION` - Go version to install (default: `1.25.1`)
336336
- `TARGETARCH` - Target architecture: `amd64` or `arm64` (default: auto-detected)
337337

.devcontainer/just/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// "build": {
55
// "dockerfile": "Dockerfile",
66
// "args": {
7-
// "INSTALL_ALL": "false"
7+
// "JUST_RECIPE": ""
88
// }
99
// },
1010
"features": {},

.github/workflows/build-devcontainer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
required: false
1717
default: 'latest'
1818
build_args:
19-
description: 'Build arguments (comma-separated, e.g., INSTALL_ALL=true,GO_VERSION=1.25.1)'
19+
description: 'Build arguments (comma-separated, e.g., JUST_RECIPE=install-all,GO_VERSION=1.25.1)'
2020
required: false
2121
type: string
2222

Justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ macos-build-container-all:
269269
# Build a container image with all components installed
270270
container system start || true
271271
IMAGE_BASE="$(echo {{IMAGE}} | cut -d: -f1)"
272-
container build -t "${IMAGE_BASE}:all" -f {{DEVCONTAINER_JUST}}/Dockerfile --build-arg TARGETARCH={{TARGETARCH}} --build-arg GO_VERSION={{GO_VERSION}} --build-arg INSTALL_ALL=true .
272+
container build -t "${IMAGE_BASE}:all" -f {{DEVCONTAINER_JUST}}/Dockerfile --build-arg TARGETARCH={{TARGETARCH}} --build-arg GO_VERSION={{GO_VERSION}} --build-arg JUST_RECIPE=install-all .
273273

274274
macos-run-container:
275275
#!/usr/bin/env bash
@@ -326,7 +326,7 @@ docker-build-all:
326326
#!/usr/bin/env bash
327327
set -euxo pipefail
328328
IMAGE_BASE="$(echo {{IMAGE}} | cut -d: -f1)"
329-
docker build -t "${IMAGE_BASE}:all" -f {{DEVCONTAINER_JUST}}/Dockerfile --build-arg TARGETARCH={{TARGETARCH}} --build-arg GO_VERSION={{GO_VERSION}} --build-arg INSTALL_ALL=true .
329+
docker build -t "${IMAGE_BASE}:all" -f {{DEVCONTAINER_JUST}}/Dockerfile --build-arg TARGETARCH={{TARGETARCH}} --build-arg GO_VERSION={{GO_VERSION}} --build-arg JUST_RECIPE=install-all .
330330

331331
docker-run:
332332
docker run --rm -it \

docs/build.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ These commands work with macOS Container CLI (`container` command):
9696
### Build
9797

9898
- `just macos-build-container` - Build container image with default settings
99-
- `just macos-build-container-all` - Build container image with `INSTALL_ALL=true`
99+
- `just macos-build-container-all` - Build container image with `JUST_RECIPE=install-all`
100100

101101
### Run & Manage
102102

@@ -114,7 +114,7 @@ These commands work with standard Docker:
114114
### Build
115115

116116
- `just docker-build` - Build Docker image with default settings
117-
- `just docker-build-all` - Build Docker image with `INSTALL_ALL=true`
117+
- `just docker-build-all` - Build Docker image with `JUST_RECIPE=install-all`
118118

119119
### Run & Manage
120120

0 commit comments

Comments
 (0)