This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"strings" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Delve into Docker", | |
"type": "go", | |
"request": "launch", | |
"mode": "remote", | |
"remotePath": "/go/src/github.com/kaperys/delve-into-docker-app", | |
"port": 40000, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang | |
WORKDIR /go/src/github.com/kaperys/delve-into-docker-app | |
EXPOSE 40000 1541 | |
RUN go get github.com/derekparker/delve/cmd/dlv | |
ADD main.go . | |
CMD [ "dlv", "debug", "github.com/kaperys/delve-into-docker-app", "--listen=:40000", "--headless=true", "--api-version=2", "--log" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: xray | |
xray: | |
docker run --rm \ | |
--env AWS_ACCESS_KEY_ID=$$(aws configure get aws_access_key_id) \ | |
--env AWS_SECRET_ACCESS_KEY=$$(aws configure get aws_secret_access_key) \ | |
--env AWS_REGION=eu-west-2 \ | |
--name xray-daemon \ | |
--publish 2000:2000/udp \ | |
amazon/aws-xray-daemon -o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion : '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: Emoji Service | |
Resources: | |
SearchEmojis: | |
Type: AWS::Serverless::Function | |
Properties: | |
Runtime: go1.x | |
Handler: handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"strings" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang | |
COPY . /go/src/github.com/kaperys/blog/docker-builder-pattern | |
WORKDIR /go/src/github.com/kaperys/blog/docker-builder-pattern | |
RUN go get && CGO_ENABLED=0 GOOS=linux go build -o server . | |
FROM scratch | |
LABEL maintainer="Mike Kaperys <mike@kaperys.io>" | |
COPY --from=0 /go/src/github.com/kaperys/blog/docker-builder-pattern/server /opt/kaperys/vision/server | |
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | |
ADD html/ /opt/kaperys/vision/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:latest | |
ADD . /go/src/github.com/kaperys/blog/docker-builder-pattern | |
WORKDIR /go/src/github.com/kaperys/blog/docker-builder-pattern | |
RUN go get | |
RUN go build -o server . | |
ENTRYPOINT [ "./server" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/base64" | |
"encoding/json" | |
"log" | |
"net/http" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |