Skip to content

Commit 779adad

Browse files
Copilotaepfli
andauthored
feat: Add FLAGD_BASE_IMAGE build argument to Dockerfile (#308)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: aepfli <[email protected]>
1 parent bde8977 commit 779adad

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,46 @@ We recommend:
7373

7474
---
7575

76+
## Building the Docker Image
77+
78+
The `flagd-testbed` Docker image can be built from the Dockerfile located at `flagd/Dockerfile`.
79+
80+
### Basic Build
81+
82+
To build the image with the default flagd base image:
83+
84+
```bash
85+
docker build -f flagd/Dockerfile -t flagd-testbed:latest --target testbed .
86+
```
87+
88+
### Custom Base Image
89+
90+
You can specify a custom flagd base image using the `FLAGD_BASE_IMAGE` build argument. This is useful when testing with pipeline-built or custom flagd images:
91+
92+
```bash
93+
docker build -f flagd/Dockerfile \
94+
--build-arg FLAGD_BASE_IMAGE=ghcr.io/open-feature/flagd:custom-tag \
95+
-t flagd-testbed:custom --target testbed .
96+
```
97+
98+
**Examples:**
99+
100+
```bash
101+
# Using a specific flagd version
102+
docker build -f flagd/Dockerfile \
103+
--build-arg FLAGD_BASE_IMAGE=ghcr.io/open-feature/flagd:v0.13.0 \
104+
-t flagd-testbed:v0.13.0 --target testbed .
105+
106+
# Using a locally built flagd image
107+
docker build -f flagd/Dockerfile \
108+
--build-arg FLAGD_BASE_IMAGE=my-custom-flagd:latest \
109+
-t flagd-testbed:dev --target testbed .
110+
```
111+
112+
If the `FLAGD_BASE_IMAGE` argument is not provided, the build defaults to `ghcr.io/open-feature/flagd:v0.12.9` to maintain backwards compatibility.
113+
114+
---
115+
76116
### Linting Gherkin Files
77117

78118
You can lint the Gherkin file structure using [gherkin-lint](https://github.com/vsiakka/gherkin-lint).

flagd/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ghcr.io/open-feature/flagd:v0.12.9 AS flagd
1+
ARG FLAGD_BASE_IMAGE=ghcr.io/open-feature/flagd:v0.12.9
2+
FROM ${FLAGD_BASE_IMAGE} AS flagd
23

34
# Build stage
45
FROM golang:1.24 AS builder

0 commit comments

Comments
 (0)