Coder Social home page Coder Social logo

Comments (6)

ahdekkers avatar ahdekkers commented on August 28, 2024 1

I'm happy to give this a go

from pingme.

pataquets avatar pataquets commented on August 28, 2024 1

Great! Let's see if @kha7iq is OK with adding this before investing time, since I can also help with it.
Once this is going, don't hesitate to ping me for review, if you feel like it or you want help with the Docker part.

from pingme.

kha7iq avatar kha7iq commented on August 28, 2024 1

Here is a Dockerfile if you would like to build from sources, the release will use the existing one as its part of goreleaser

FROM golang:1.18.4-alpine AS builder

WORKDIR /

RUN apk add --no-cache git && \
    git clone https://github.com/kha7iq/pingme.git && \
    cd /pingme && \
    go build -o pingme .


FROM alpine:3.7 as final
COPY --from=builder /pingme/pingme /usr/bin/pingme

ENTRYPOINT ["/usr/bin/pingme"]

from pingme.

kha7iq avatar kha7iq commented on August 28, 2024

Hello @pataquets
Its certainly possible to add a Dockerfile which can build from sources, at the moment the docker build is a part of release workflow with goreleaser once the binary is built from sources its then copied to image.
You are right it will be easier to build from sources to do any kind of testing, let me see what will be the best way to do this. Having 2 Dockerfiles in the repo will be confusing.

from pingme.

pataquets avatar pataquets commented on August 28, 2024

Thanks for the prompt feedback, @kha7iq .
I would add that, other than testing, a Dockerfile would enable easier contribution to development by ease code/build/run workflow.

I'm not too familiar with goreleaser, but at first guess I see two approaches (surely, might be some more I haven't thought of):

  • Run goreleaser inside the Docker container. Not the leanest if you want multi-arch Docker images, AFAICT.
  • Drop goreleaser and build the code without it, just on the Docker build. Yup, at first sight, that would mean two different CI actions, unless we figure out how to do it from Docker, which doesn't sound too far-fetched, thou.

Since I'm not sure what goreleaser brings to the table (other than a cursory read at your link), the Docker build can match what's being done now:

  • Can build and push multi-arch Docker images
  • Can produce very small images as done currently, no matter how big the build image is, by using multi-stage builds.

I'm sure there are other advantages on using goreleaser which I can't grasp, so let me know if you see unsolved issues, and I'll try to help as best as I can.

from pingme.

kha7iq avatar kha7iq commented on August 28, 2024

goreleaser has a workflow setup right now, it builds the binaries for linux,mac,windows and deb and rpms with multi arch. you can have a look at the release page
It also generate change log and update scoop for windows & brew for macos along with a docker image.

from pingme.

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.