forked from ceph/ceph-cosi
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from shanduur/chore/major-cleanup
chore: major cleanup
- Loading branch information
Showing
18 changed files
with
698 additions
and
620 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Binaries for programs and plugins | ||
bin/ | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories | ||
vendor/ | ||
|
||
# Go workspace file | ||
go.work | ||
|
||
# MacOS attributes files | ||
.DS_Store | ||
|
||
# Editor configurations | ||
.idea/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
# Editor configuration, see https://editorconfig.org | ||
; https://editorconfig.org/ | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[{Makefile,go.mod,go.sum,*.go,.gitmodules}] | ||
indent_size = 4 | ||
indent_style = tab | ||
|
||
[*.md] | ||
max_line_length = off | ||
indent_size = 4 | ||
trim_trailing_whitespace = false | ||
|
||
eclint_indent_style = unset | ||
|
||
[Dockerfile] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,26 @@ | ||
*.tmp | ||
# Binaries for programs and plugins | ||
bin/ | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories | ||
vendor/ | ||
|
||
# Go workspace file | ||
go.work | ||
|
||
# MacOS attributes files | ||
.DS_Store | ||
.build | ||
*.swp | ||
bin | ||
.idea | ||
|
||
# Editor configurations | ||
.idea/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,74 @@ | ||
FROM gcr.io/distroless/static:latest | ||
LABEL Name="s3gw-cosi-driver" | ||
LABEL maintainers="s3gw maintainers" | ||
LABEL description="s3gw COSI driver" | ||
######################################################################################### | ||
# Build | ||
######################################################################################### | ||
|
||
# First stage: building the driver executable. | ||
FROM docker.io/library/golang:1.22.3 as builder | ||
|
||
# Set the working directory. | ||
WORKDIR /work | ||
|
||
# Prepare dir so it can be copied over to runtime layer. | ||
RUN mkdir -p /var/lib/cosi | ||
|
||
# Copy the Go Modules manifests. | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
|
||
# Cache dep before building and copying source so that we don't need to re-download as | ||
# much and so that source changes don't invalidate our downloaded layer. | ||
RUN go mod download | ||
|
||
# Copy the go source. | ||
COPY Makefile Makefile | ||
COPY cmd/ cmd/ | ||
COPY pkg/ pkg/ | ||
|
||
# Build. | ||
RUN make build | ||
|
||
######################################################################################### | ||
# Runtime | ||
######################################################################################### | ||
|
||
# Second stage: building final environment for running the executable. | ||
FROM gcr.io/distroless/static:latest AS runtime | ||
|
||
# Copy the executable. | ||
COPY --from=builder --chown=65532:65532 /work/bin/s3gw-cosi-driver /usr/bin/s3gw-cosi-driver | ||
|
||
# Copy the volume directory with correct permissions, so driver can bind a socket there. | ||
COPY --from=builder --chown=65532:65532 /var/lib/cosi /var/lib/cosi | ||
|
||
# Set volume mount point for app socket. | ||
VOLUME [ "/var/lib/cosi" ] | ||
|
||
# Set the final UID:GID to non-root user. | ||
USER 65532:65532 | ||
|
||
# Disable healthcheck. | ||
HEALTHCHECK NONE | ||
|
||
# Few Args for dynamically setting labels. | ||
ARG QUAY_EXPIRATION=Never | ||
ARG S3GW_VERSION=Development | ||
ARG ID=s3gw-cosi-driver | ||
|
||
ENV ID=${ID} | ||
# Add labels. | ||
|
||
## Standard opencontainers labels. | ||
LABEL org.opencontainers.image.title="s3gw-cosi-driver" | ||
LABEL org.opencontainers.image.description="COSI Driver for s3gw" | ||
LABEL org.opencontainers.image.authors="s3gw maintainers" | ||
LABEL org.opencontainers.image.vendor="s3gw-tech" | ||
LABEL org.opencontainers.image.version="${S3GW_VERSION}" | ||
LABEL org.opencontainers.image.license="Apache-2.0" | ||
LABEL org.opencontainers.image.source="https://github.com/s3gw-tech/s3gw-cosi-driver" | ||
LABEL org.opencontainers.image.documentation="http://docs.s3gw.tech" | ||
LABEL org.opencontainers.image.base.name="gcr.io/distroless/static:latest" | ||
|
||
LABEL Version=${S3GW_VERSION} | ||
LABEL quay.expires-after=${QUAY_EXPIRATION} | ||
## Quay specific labels. | ||
LABEL quay.expires-after="${QUAY_EXPIRATION}" | ||
|
||
COPY ./bin/s3gw-cosi-driver s3gw-cosi-driver | ||
ENTRYPOINT ["/s3gw-cosi-driver"] | ||
# Set the entrypoint. | ||
ENTRYPOINT [ "/usr/bin/s3gw-cosi-driver" ] | ||
CMD [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.