diff --git a/.gitignore b/.gitignore index b3ebf572..59936a3e 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ .idea/ vendor/ -cmd/device-rfid-llrp-go +cmd/device-rfid-llrp glide.lock # snap files diff --git a/Dockerfile b/Dockerfile index dd85cb50..f93fbccc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ ARG ALPINE_PKG_EXTRA="" RUN sed -e 's/dl-cdn[.]alpinelinux.org/nl.alpinelinux.org/g' -i~ /etc/apk/repositories RUN apk add --no-cache ${ALPINE_PKG_BASE} ${ALPINE_PKG_EXTRA} -WORKDIR $GOPATH/src/github.com/edgexfoundry/device-rfid-llrp-go +WORKDIR /app COPY . . RUN [ ! -d "vendor" ] && go mod download all || echo "skipping..." @@ -40,11 +40,12 @@ LABEL license='SPDX-License-Identifier: Apache-2.0' \ RUN sed -e 's/dl-cdn[.]alpinelinux.org/nl.alpinelinux.org/g' -i~ /etc/apk/repositories RUN apk add --update --no-cache zeromq dumb-init -COPY --from=builder /go/src/github.com/edgexfoundry/device-rfid-llrp-go/LICENSE / -COPY --from=builder /go/src/github.com/edgexfoundry/device-rfid-llrp-go/Attribution.txt / -COPY --from=builder /go/src/github.com/edgexfoundry/device-rfid-llrp-go/cmd / +COPY --from=builder /app/LICENSE / +COPY --from=builder /app/Attribution.txt / +COPY --from=builder /app/cmd/device-rfid-llrp /device-rfid-llrp +COPY --from=builder /app/cmd/res/ / EXPOSE 59989 -ENTRYPOINT ["/device-rfid-llrp-go"] +ENTRYPOINT ["/device-rfid-llrp"] CMD ["-cp=consul.http://edgex-core-consul:8500", "--confdir=/res", "--registry"] diff --git a/Makefile b/Makefile index b47a2133..80307e98 100644 --- a/Makefile +++ b/Makefile @@ -2,24 +2,21 @@ GO=CGO_ENABLED=1 GO111MODULE=on go -MICROSERVICES=cmd/device-rfid-llrp-go +MICROSERVICES=cmd/device-rfid-llrp .PHONY: $(MICROSERVICES) -DOCKERS=docker_device_rfid_llrp_go -.PHONY: $(DOCKERS) - VERSION=$(shell cat ./VERSION 2>/dev/null || echo 0.0.0) GIT_SHA=$(shell git rev-parse HEAD) -GOFLAGS=-ldflags "-X github.com/edgexfoundry/device-rfid-llrp-go.Version=$(VERSION)" +GOFLAGS=-ldflags "-X github.com/edgexfoundry/device-rfid-llrp.Version=$(VERSION)" build: $(MICROSERVICES) tidy: go mod tidy -cmd/device-rfid-llrp-go: +cmd/device-rfid-llrp: $(GO) build $(GOFLAGS) -o $@ ./cmd test: @@ -32,15 +29,13 @@ test: clean: rm -f $(MICROSERVICES) -docker: $(DOCKERS) - -docker_device_rfid_llrp_go: +docker: docker build \ --build-arg http_proxy \ --build-arg https_proxy \ --label "git_sha=$(GIT_SHA)" \ - -t edgexfoundry/docker-device-rfid-llrp-go:$(GIT_SHA) \ - -t edgexfoundry/docker-device-rfid-llrp-go:$(VERSION)-dev \ + -t edgexfoundry/device-rfid-llrp:$(GIT_SHA) \ + -t edgexfoundry/device-rfid-llrp:$(VERSION)-dev \ . vendor: