GithubHelp home page GithubHelp logo

widnyana / dockerfiles Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 55 KB

a dockerfiles collection

Home Page: https://widnyana.web.id/blog/software-engineering/docker-multistage-build/

License: Do What The F*ck You Want To Public License

Dockerfile 72.09% Shell 27.91%
dockerfiles docker golang continuous-integration

dockerfiles's Introduction

Dockerfiles

go release workflow node release workflow

Container image collections

Available tags

  • widnyana/go-builder: for your golang multistage build process, see: docker hub
  • widnyana/pm2: for serving nodejs app using PM2 docker hub

*please refers to Dockerfile on each directory for detailed package installed on the container.

Usage

A brief usage explanations for each tags

widnyana/go-builder

FROM widnyana/go-builder:1.13-alpine as builder
WORKDIR /app
COPY . /app

ENV GO111MODULE=on \
    CGO_ENABLED=0 \
    GOOS=linux

RUN set -ex \
    && cd /app \
    && go mod download \
        && GIT_TAG=$(git describe --abbrev=0 2> /dev/null || echo "no tag") \
            COMMIT=$(git log -1 --pretty=format:"%at-%h" 2> /dev/null || echo "no commit") \
            COMMIT_MSG=$(git log -1 --pretty=format:"%s"2> /dev/null || echo "no msg") \
            go build -a -i \
                -ldflags "-w \
                    -X 'package/config.CommitMsg=${COMMIT_MSG}' \
                    -X 'package/config.CommitHash=${COMMIT}' \
                    -X 'package/config.AppVersion=${GIT_TAG}'" \
                    -o whatever \
FROM alpine:latest

ARG WHATEVER_HTTP_PORT=2525
WORKDIR /root/
COPY --from=builder /app/whatever .

# Do as you want ...

License

Copyright © 2020 widnyana <wid -at- widnyana.web.id>

This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar.

dockerfiles's People

Contributors

widnyana avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.