Giter Club home page Giter Club logo

Comments (2)

Prophecy67 avatar Prophecy67 commented on August 22, 2024

This should definitely work. I've got this as a working concept.

FROM golang
WORKDIR /go
RUN go get gopkg.in/Luzifer/ots.v0
WORKDIR src/gopkg.in/Luzifer/ots.v0/
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .

FROM scratch  
COPY --from=0 /go/src/gopkg.in/Luzifer/ots.v0/main /main
ENTRYPOINT ["./main"]

from ots.

Luzifer avatar Luzifer commented on August 22, 2024
luzifer/ots     latest     0f52edc23446     3 hours ago       18.9MB
<none>          <none>     9a9b3b7febf2     8 seconds ago     12.7MB

Using scratch with only the binary inside would only mean a 6.2M reduction but a loss of any components possibly usable for later addition of additional storage providers requiring certificates or similar.

I had a look at the gcr.io/distroless/base image and the build process is totally intransparent: There is no Dockerfile but a bazel build loading stuff from some rulesets.

So for now the build in this repo will stay using alpine as its base.

If you want not to have the alpine base in the image you're using, I'm adding a Dockerfile.minimal to the repo you can use to docker build -f Dockerfile.minimal . an image without an alpine base.

from ots.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.