Move ARGs to prevent invalidating docker caches
Having the ARG at the top of the dockerfiles
cause all the cached layers below to be invalidated
resulting in needlessly re-downloading or re-copying
files
Change-Id: Ie701b1556ee21ecdcf629e06c9b26d80af0fb344
diff --git a/docker/Dockerfile.afrouter b/docker/Dockerfile.afrouter
index 04cbf4c..40b5423 100644
--- a/docker/Dockerfile.afrouter
+++ b/docker/Dockerfile.afrouter
@@ -17,13 +17,6 @@
FROM golang:1.12-alpine3.9 AS build-env
-ARG org_label_schema_version=unknown
-ARG org_label_schema_vcs_url=unknown
-ARG org_label_schema_vcs_ref=unknown
-ARG org_label_schema_build_date=unknown
-ARG org_opencord_vcs_commit_date=unknown
-ARG org_opencord_vcs_dirty=unknown
-
# Install required packages
RUN apk add --no-cache wget git make build-base protobuf protobuf-dev
@@ -49,6 +42,13 @@
RUN cp afrouter/arouter.json /build
RUN cp vendor/github.com/opencord/voltha-protos/go/voltha.pb /build
+ARG org_label_schema_version=unknown
+ARG org_label_schema_vcs_url=unknown
+ARG org_label_schema_vcs_ref=unknown
+ARG org_label_schema_build_date=unknown
+ARG org_opencord_vcs_commit_date=unknown
+ARG org_opencord_vcs_dirty=unknown
+
# Build
RUN cd afrouter && go build -o /build/afrouter \
-ldflags \