Skip to content

Instantly share code, notes, and snippets.

View treeder's full-sized avatar
🥌

Travis Reeder treeder

🥌
View GitHub Profile

hi

there

# build stage
FROM golang:alpine AS build-env
ADD . /src
RUN cd /src && go build -o goapp
# final stage
FROM alpine
WORKDIR /app
COPY --from=build-env /src/goapp /app/
CMD ./goapp
@treeder
treeder / main.go
Last active September 27, 2019 17:41
package main
import (
"io"
"log"
"net/http"
"os"
)
func hello(w http.ResponseWriter, r *http.Request) {
@treeder
treeder / Dockerfile
Last active August 12, 2019 21:29
multi-stage build
# build stage
FROM golang:alpine AS build-env
RUN apk --no-cache add build-base git bzr mercurial gcc
ADD . /src
RUN cd /src && go build -o goapp
# final stage
FROM alpine
WORKDIR /app
COPY --from=build-env /src/goapp /app/
@treeder
treeder / Dockerfile
Created April 27, 2017 19:31
single stage
FROM golang:alpine
WORKDIR /app
ADD . /app
RUN cd /app && go build -o goapp
ENTRYPOINT ./goapp
package main
import "fmt"
func main() {
fmt.Println("Hello world!")
}
package main
import (
"context"
"github.com/iron-io/functions/api/server"
)
func main() {
ctx := context.Background()
@treeder
treeder / cla.md
Created November 15, 2016 14:59
Iron.io CLA

Iron.io, Inc.

Contributor License Agreement

Thank you for your interest in the open source project(s) managed by Iron.io, Inc. (“Iron.io”). In order to clarify the intellectual property license granted with Contributions from any person or entity, Iron.io must have a Contributor License Agreement (“CLA”) on file that has been signed by each contributor, indicating agreement to the license terms below. This license is for your protection as a contributor as well as the protection of Iron.io and its other contributors and users; it does not change your rights to use your own Contributions for any other purpose.

By clicking “Accept” on this page You accept and agree to these terms and conditions for Your present and future Contributions submitted to Iron.io. In return, Iron.io shall consider Your Contributions for addition to the official Iron.io open source project(s) for which they were submitted. Except for the license granted herein to Iron.io and recipients of software distributed by Iron.io, You re

@treeder
treeder / app.go
Created September 20, 2016 02:27
package main
import (
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
)
require 'iron_mq'
ironmq = IronMQ::Client.new
q = ironmq.queue("my_queue")
while true
msg = q.get
if msg.nil?
sleep 5
next
end