Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize for k8s app install option #16

Closed
nickshine opened this issue Jan 18, 2020 · 3 comments
Closed

Dockerize for k8s app install option #16

nickshine opened this issue Jan 18, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request
Projects
Milestone

Comments

@nickshine
Copy link
Collaborator

No description provided.

@nickshine nickshine added the enhancement New feature or request label Jan 18, 2020
@nickshine nickshine added this to the 1.0 milestone Jan 18, 2020
@nickshine nickshine self-assigned this Jan 18, 2020
@nickshine nickshine added this to To do in 1.0 via automation Jan 18, 2020
@nickshine nickshine moved this from To do to In progress in 1.0 Jan 18, 2020
@circa10a
Copy link
Owner

circa10a commented Jan 18, 2020

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"]

@circa10a
Copy link
Owner

circa10a commented Jan 18, 2020

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.

@nickshine nickshine moved this from In progress to Done in 1.0 Jan 19, 2020
@nickshine
Copy link
Collaborator Author

nickshine commented Jan 19, 2020

done with #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
1.0
  
Done
Development

No branches or pull requests

2 participants