Skip to content

Commit

Permalink
fix: Resolved all comments made by Lenny for Makefile and Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-philippe Fuller <marc-philippe.fuller@intel.com>
  • Loading branch information
marcpfuller committed Jan 6, 2022
1 parent 07c5e43 commit 0fbcaaa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

.idea/
vendor/
cmd/device-rfid-llrp-go
cmd/device-rfid-llrp
glide.lock

# snap files
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand All @@ -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"]
17 changes: 6 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 0fbcaaa

Please sign in to comment.