Skip to content

Commit 58ddc4a

Browse files
ryanschzxaos
authored andcommitted
Build with docker
1 parent 64eb744 commit 58ddc4a

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM golang:1.19-bullseye
2+
3+
WORKDIR $GOPATH/src/github.com/fly-apps/terraform-provider-fly
4+
COPY go.mod .
5+
RUN go mod download -x
6+
RUN mkdir -p /out/
7+
8+
COPY . .
9+
RUN go env; go install; cp $GOPATH/bin/terraform-provider-fly /out/
10+
11+
WORKDIR $GOPATH

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,11 @@ To run acceptance tests for this provider some scaffolding is required.
3636
4. Got to the infra directory and run `terraform apply` to create the scaffolding.
3737
5. You should now be able to run `make` in the repo root to run tests.
3838
6. (Optional) set FLY_TF_TEST_REGION in `.make-overrides` to a region closer to you
39+
40+
### Building with Docker
41+
If you don't have a local Go environment, you can build in a container:
42+
43+
```
44+
docker build --pull -t provider-fly:latest .
45+
docker run --rm --entrypoint=cat provider-fly:latest /out/terraform-provider-fly > terraform-provider-fly
46+
```

0 commit comments

Comments
 (0)