feat(docker): add opencontainer labels
Some checks failed
continuous-integration/drone/push Build is failing

Resolves https://github.com/go-vikunja/vikunja/issues/308
This commit is contained in:
kolaente 2024-08-29 11:19:21 +02:00
parent efde364224
commit 07bd9de0c6
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 28 additions and 1 deletions

View File

@ -35,7 +35,14 @@ RUN export PATH=$PATH:$GOPATH/bin && \
# The actual image
FROM scratch
LABEL maintainer="maintainers@vikunja.io"
LABEL org.opencontainers.image.authors='maintainers@vikunja.io'
LABEL org.opencontainers.image.url='https://vikunja.io'
LABEL org.opencontainers.image.documentation='https://vikunja.io/docs'
LABEL org.opencontainers.image.source='https://code.vikunja.io/vikunja'
LABEL org.opencontainers.image.licenses='AGPLv3'
LABEL org.opencontainers.image.title='Vikunja'
WORKDIR /app/vikunja
ENTRYPOINT [ "/app/vikunja/vikunja" ]
EXPOSE 3456

View File

@ -464,6 +464,26 @@ func (Build) Build() {
runAndStreamOutput("go", "build", Goflags[0], "-tags", Tags, "-ldflags", "-s -w "+Ldflags, "-o", Executable)
}
func (Build) SaveVersionToFile() error {
// Open the file for writing. If the file doesn't exist, create it.
// If it exists, truncate it.
file, err := os.Create("VERSION")
if err != nil {
return fmt.Errorf("error creating VERSION file: %w", err)
}
defer file.Close()
// Write the version number to the file
_, err = file.WriteString(VersionNumber)
if err != nil {
return fmt.Errorf("error writing to VERSION file: %w", err)
}
fmt.Println("Version number saved successfully to VERSION file")
return nil
}
type Release mg.Namespace
// Runs all steps in the right order to create release packages for various platforms