Comments (3)
Two possibilities:
- Simple multistage image, using alpine as base image, includes apk and shell (21Mb)
- Statically compiled with empty base image (scratch), in the spirit of distroless, (14Mb).
Simple multistage
FROM golang:alpine as build
WORKDIR /usr/src/app
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN go build -v -o /usr/local/bin/pure-fa-om-exporter cmd/fa-om-exporter/main.go
FROM alpine
COPY --from=build /usr/local/bin/pure-fa-om-exporter /usr/local/bin/pure-fa-om-exporter
EXPOSE 9490
ENTRYPOINT ["/usr/local/bin/pure-fa-om-exporter"]
CMD ["--host", "0.0.0.0", "--port", "9490"]
$ docker history pure-fa-om-exporter
IMAGE CREATED BY SIZE COMMENT
51d99b9251e5 /bin/sh -c #(nop) CMD ["--host" "0.0.0.0" "… 0B
353a48112424 /bin/sh -c #(nop) ENTRYPOINT ["/usr/local/b… 0B
d2a24d618855 /bin/sh -c #(nop) EXPOSE 9490 0B
1ca44db4f499 /bin/sh -c #(nop) COPY file:30dad3c48b73c1a1… 13.6MB
042a816809aa /bin/sh -c #(nop) CMD ["/bin/sh"] 0B
<missing> /bin/sh -c #(nop) ADD file:e4d600fc4c9c293ef… 7.05MB
Statically compiled (14Mb)
Go-lang compilation options for static build are inspired by prometheus/node-exporter.
Some projects also provides container with a shell (typically busybox)
FROM golang:alpine as build
WORKDIR /usr/src/app
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
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' -v -o /usr/local/bin/pure-fa-om-exporter cmd/fa-om-exporter/main.go
FROM scratch
#FROM busybox:musl
COPY --from=build /usr/local/bin/pure-fa-om-exporter /pure-fa-om-exporter
EXPOSE 9490
ENTRYPOINT ["/pure-fa-om-exporter"]
CMD ["--host", "0.0.0.0", "--port", "9490"]
$ docker history d6274a0aaee5
IMAGE CREATED BY SIZE COMMENT
d6274a0aaee5 /bin/sh -c #(nop) CMD ["--host" "0.0.0.0" "… 0B
7a04a959cb79 /bin/sh -c #(nop) ENTRYPOINT ["/pure-fa-om-… 0B
3bb9c2a0527f /bin/sh -c #(nop) EXPOSE 9490 0B
03bae96ab57e /bin/sh -c #(nop) COPY file:4774cc7a4b571ef1… 13.5MB
from pure-fa-openmetrics-exporter.
Thanks for noticing this! It is now fixed in v1.0.4.
from pure-fa-openmetrics-exporter.
fixed in 07f77ff (Thanks to @genegr )
from pure-fa-openmetrics-exporter.
Related Issues (20)
- CVE-2023-45286 is causing issues with Quay Scanner
- Update useragent string to reflect calling platform HOT 3
- Collect Frontent WWPN Information HOT 9
- Array Load Statistics metric HOT 5
- purefa_alerts_open not reporting correctly HOT 4
- Add better error handling when the API token is incorrect. HOT 2
- PodReplicaLink is not in seconds HOT 3
- Add vendor directory to manage deps
- [new metric label proposal] - Add subscription info
- Add OME version to user_agent string
- [new metrics proposal] Volume snapshot metrics HOT 1
- (question not an issue) Helm chart available? HOT 3
- [Question] How does the token file in exporter work? HOT 9
- Warning docker-compose.yaml - **`version` is obsolete** HOT 1
- docker-compose.yaml file using deprecated storage.tsdb.retention replace with 'storage.tsdb.retention.time HOT 1
- The OpenMetrics exporter is incorrectly calling the /hardware endpoint HOT 3
- [new metric proposal] - Drive capacity metrics - purefa_drive_capacity HOT 1
- Enhancements to purefa_alerts_open, collect additional fields. HOT 5
- Inquiry regarding the “Purestorage” version supported by the current “exporter” and the previous “exporter” HOT 8
- Grafana not showing data as expected with multiple arrays HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pure-fa-openmetrics-exporter.