Skip to content

Commit

Permalink
Merge pull request #122 from PureStorage-OpenConnect/120-add-vendor-d…
Browse files Browse the repository at this point in the history
…irectory-to-manage-deps

Correct Dockerfile to use mod=readonly
  • Loading branch information
sdodsley authored Mar 8, 2024
2 parents 726300b + 67445a2 commit 3e22f06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Binary downloads of the exporter can be found on the [Releases](https://github.c

The following commands describe how to run a typical build :
```shell

# clone the repository
git clone [email protected]:PureStorage-OpenConnect/pure-fa-openmetrics-exporter.git

Expand All @@ -54,7 +53,13 @@ cd pure-fa-openmetrics-exporter
make build .
```

The newly built exporter executable can be found in the <kbd>./out/bin</kbd> directory.
The newly built exporter binary can be found in the <kbd>./out/bin</kbd> directory.

Optionally, to build the binary with the vendor cache, you may use

````
make build-with-vendor
````

### Docker Image

Expand Down
2 changes: 1 addition & 1 deletion build/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY . .
RUN CGO_ENABLED=1 go build -a -tags 'netgo osusergo static_build' -ldflags="-X main.version=v$VERSION" -v -o /usr/local/bin/pure-fa-om-exporter cmd/fa-om-exporter/main.go
RUN CGO_ENABLED=1 go build -mod=readonly -a -tags 'netgo osusergo static_build' -ldflags="-X main.version=v$VERSION" -v -o /usr/local/bin/pure-fa-om-exporter cmd/fa-om-exporter/main.go


# alpine is used here as it seems to be the minimal image that passes quay.io vulnerability scan
Expand Down

0 comments on commit 3e22f06

Please sign in to comment.