diff --git a/Dockerfile b/Dockerfile index 6f62dc9..7284ee9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/Makefile b/Makefile index e0e0f39..16bb51d 100644 --- a/Makefile +++ b/Makefile @@ -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)" .