Skip to content

Commit

Permalink
Use standard crossbuild for docker build instead of spinning up a doc…
Browse files Browse the repository at this point in the history
…ker build container.
  • Loading branch information
Chaz Larson committed May 9, 2019
1 parent 48b965a commit 741108c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
17 changes: 1 addition & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
FROM golang:alpine as builder

# Install git because gin/yaml needs it
# Install make for building
RUN apk update && apk upgrade && apk add git make

# Copy the code from the host and compile it
WORKDIR $GOPATH/src/github.com/tellytv/telly
COPY . ./

# Build the executable using promu since that builds in the version info
# copy the resulting executable to the root under the name "app"
RUN make promu && make build && mv ./telly /app

FROM scratch
# Original: copy from the builder image above:
COPY --from=builder /app ./
COPY .build/linux-amd64/telly ./app
EXPOSE 6077
ENTRYPOINT ["./app"]

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tarball: promu
@echo ">> building release tarball"
@$(PROMU) tarball $(BIN_DIR)

docker:
docker: cross
@echo ">> building docker image"
@docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .

Expand Down

0 comments on commit 741108c

Please sign in to comment.