Git Product home page Git Product logo

Comments (3)

circa10a avatar circa10a commented on June 21, 2024 1

Here's what I did for my other project. Am pretty happy with it

FROM golang:alpine
WORKDIR /go/src/app
COPY . .
ENV USER=go \
    UID=1000 \
    GID=1000 \
    GOOS=linux \
    GOARCH=amd64 \
    CGO_ENABLED=0

RUN go build -ldflags="-s -w" -o webhook && \
    addgroup --gid "$GID" "$USER" && \
    adduser \
    --disabled-password \
    --gecos "" \
    --home "$(pwd)" \
    --ingroup "$USER" \
    --no-create-home \
    --uid "$UID" \
    "$USER" && \
    chown "$UID":"$GID" /go/src/app/webhook

FROM scratch
ENV GIN_MODE=release \
    METRICS=true
COPY --from=0 /etc/passwd /etc/passwd
COPY --from=0 /go/src/app/webhook /
USER 1000
ENTRYPOINT ["/webhook"]

from go-aws-news.

circa10a avatar circa10a commented on June 21, 2024

I've added environment variables DOCKER_USERNAME and DOCKER_PASSWORD in travis for publishing docker images via ci.

Here's what I did for my other go project to publish docker images via travis.

from go-aws-news.

nickshine avatar nickshine commented on June 21, 2024

done with #17

from go-aws-news.

Related Issues (12)

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.