Skip to content

Commit

Permalink
Migrating project to use go module support with go 1.11.
Browse files Browse the repository at this point in the history
A go.mod was created from the existing go dep files. Also, the
docker build is now a two step process and the container is a
minimal container. A static and cross-compiled binary must
first be created on the local machine. This binary is copied into
the container when it is built.
  • Loading branch information
Jacob MacElroy committed Aug 27, 2018
1 parent 9e09134 commit 088d3a0
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 196 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
*.out

vendor
main
18 changes: 3 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
FROM golang:1.10.3

# Copy the local package files to the container's workspace.
ADD . /go/src/github.com/jitsi/jitsi-slack

# Install godep and vendor dependencies.
RUN go get -u github.com/golang/dep/cmd/dep
WORKDIR /go/src/github.com/jitsi/jitsi-slack
RUN dep ensure

# Build the api command.
RUN go install github.com/jitsi/jitsi-slack/cmd/api

ENTRYPOINT /go/bin/api

FROM scratch
ADD main /
CMD ["/main"]
EXPOSE 8080
127 changes: 0 additions & 127 deletions Gopkg.lock

This file was deleted.

54 changes: 0 additions & 54 deletions Gopkg.toml

This file was deleted.

7 changes: 7 additions & 0 deletions build_docker_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -x

rm ./main
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o main ./cmd/api/
docker build -t $1 .
17 changes: 17 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module github.com/jitsi/jitsi-slack

require (
github.com/aws/aws-sdk-go v1.15.6
github.com/caarlos0/env v3.3.0+incompatible
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/go-ini/ini v1.38.1
github.com/gorilla/websocket v1.2.0
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8
github.com/justinas/alice v0.0.0-20171023064455-03f45bd4b7da
github.com/nlopes/slack v0.3.0
github.com/rs/xid v1.2.0
github.com/rs/zerolog v1.8.0
github.com/vincent-petithory/dataurl v0.0.0-20160330182126-9a301d65acbb
github.com/zenazn/goji v0.0.0-20160507202103-64eb34159fe5
golang.org/x/sys v0.0.0-20180808154034-904bdc257025
)
27 changes: 27 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
github.com/aws/aws-sdk-go v1.15.6 h1:JRgUEp143FVHH3LOV2ggH2f6h+Tl1EgGphqaoH/Xibk=
github.com/aws/aws-sdk-go v1.15.6/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/caarlos0/env v3.3.0+incompatible h1:jCfY0ilpzC2FFViyZyDKCxKybDESTwaR+ebh8zm6AOE=
github.com/caarlos0/env v3.3.0+incompatible/go.mod h1:tdCsowwCzMLdkqRYDlHpZCp2UooDD3MspDBjZ2AD02Y=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-ini/ini v1.38.1 h1:hbtfM8emWUVo9GnXSloXYyFbXxZ+tG6sbepSStoe1FY=
github.com/go-ini/ini v1.38.1/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/gorilla/websocket v1.2.0 h1:VJtLvh6VQym50czpZzx07z/kw9EgAxI3x1ZB8taTMQQ=
github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Aowv3l/EQUlocDHW2Cp4G9WJVH7uyH8QFJE=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/justinas/alice v0.0.0-20171023064455-03f45bd4b7da h1:5y58+OCjoHCYB8182mpf/dEsq0vwTKPOo4zGfH0xW9A=
github.com/justinas/alice v0.0.0-20171023064455-03f45bd4b7da/go.mod h1:oLH0CmIaxCGXD67VKGR5AacGXZSMznlmeqM8RzPrcY8=
github.com/nlopes/slack v0.3.0 h1:jCxvaS8wC4Bb1jnbqZMjCDkOOgy4spvQWcrw/TF0L0E=
github.com/nlopes/slack v0.3.0/go.mod h1:jVI4BBK3lSktibKahxBF74txcK2vyvkza1z/+rRnVAM=
github.com/rs/xid v1.2.0 h1:qRPemPiF/Pl06j+Pp5kjRpgRmUJCsfdPcFo/LZlsobA=
github.com/rs/xid v1.2.0/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/zerolog v1.8.0 h1:Oglcb4i6h42uWacEjomB2MI8gfkwCwTMFaDY3+Vgj5k=
github.com/rs/zerolog v1.8.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
github.com/vincent-petithory/dataurl v0.0.0-20160330182126-9a301d65acbb h1:lyL3z7vYwTWXf4/bI+A01+cCSnfhKIBhy+SQ46Z/ml8=
github.com/vincent-petithory/dataurl v0.0.0-20160330182126-9a301d65acbb/go.mod h1:FHafX5vmDzyP+1CQATJn7WFKc9CvnvxyvZy6I1MrG/U=
github.com/zenazn/goji v0.0.0-20160507202103-64eb34159fe5 h1:u8oGm2Ef+uUdJIbBXJvdPqKeo1u8NPGMtWH521eW2xA=
github.com/zenazn/goji v0.0.0-20160507202103-64eb34159fe5/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
golang.org/x/sys v0.0.0-20180808154034-904bdc257025 h1:vE4lpaOfhRi5ci1V4lyWFx2Rg3CXZNaN09Q1e+GKioA=
golang.org/x/sys v0.0.0-20180808154034-904bdc257025/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

0 comments on commit 088d3a0

Please sign in to comment.