Skip to content

Commit

Permalink
fix: api changes (#30)
Browse files Browse the repository at this point in the history
Changes:
- updated buf in api/Dockerfile
- actually enabled api build using custom image
  • Loading branch information
jgkawell authored Aug 3, 2024
1 parent f9d9418 commit f768ba5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM golang:1.21-alpine
RUN apk add --update --no-cache npm

# install buf
RUN go install github.com/bufbuild/buf/cmd/buf@v1.33.0
RUN go install github.com/bufbuild/buf/cmd/buf@v1.35.1

# install protoc plugins

Expand Down
10 changes: 9 additions & 1 deletion tools/dctl/cmd/api/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ func Build(cmd *cobra.Command, args []string) (err error) {
return nil
}

var image string
if ImageName != "" {
image = ImageName
output.Print("Using image: %s", image)
} else {
image = dctx.API.ImageName
}

// build out execution path
rootPath := dctx.Root
apiPath := filepath.Join(rootPath, "api")
Expand All @@ -34,7 +42,7 @@ func Build(cmd *cobra.Command, args []string) (err error) {

// base configuration for docker container runs
config := &container.Config{
Image: dctx.API.ImageName,
Image: image,
WorkingDir: "/workspace",
}
hostConfig := &container.HostConfig{
Expand Down
4 changes: 2 additions & 2 deletions tools/dctl/cmd/api/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
)

var (
BuildImage bool
ImageName string
BuildImage bool
ImageName string
)

func Init(cmd *cobra.Command, args []string) error {
Expand Down

0 comments on commit f768ba5

Please sign in to comment.