Skip to content

Commit

Permalink
Simplify build using --build-arg
Browse files Browse the repository at this point in the history
  • Loading branch information
jvassev committed Jul 3, 2018
1 parent 8042b9a commit 3b33946
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion base-image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ IMAGE ?= vmware/base-fluentd-operator
TAG ?= latest

build-image:
docker build . -t $(IMAGE):$(TAG)
docker build -t $(IMAGE):$(TAG) .

shell:
docker run --entrypoint=/bin/bash \
Expand Down
2 changes: 1 addition & 1 deletion config-reloader/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ COPY . .

# Speed up local builds where vendor is populated
RUN [ -d vendor/github.com ] || make dep; true

ARG VERSION
RUN make test
RUN make build VERSION=$VERSION

Expand Down
4 changes: 1 addition & 3 deletions config-reloader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ clean:
rm -fr config-reloader pkg > /dev/null

build-image:
cat Dockerfile | \
VERSION=$(VERSION) envsubst '$$VERSION' | \
docker build . -f - -t $(IMAGE):$(TAG)
docker build --build-arg VERSION=$(VERSION) -t $(IMAGE):$(TAG) .

push-image: build-image
docker push $(IMAGE):$(TAG)
Expand Down

0 comments on commit 3b33946

Please sign in to comment.