Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardized test image Makefile targets #16295

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 10 additions & 5 deletions test/images/dnsutils/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
all:
@echo "try 'make image' or 'make push'"
# This image does not tag
#TAG =
PREFIX = gcr.io/google_containers

all: push

image:
docker build -t gcr.io/google_containers/dnsutils .
docker build -t $(PREFIX)/dnsutils .

push: image
gcloud docker push $(PREFIX)/dnsutils

push:
gcloud docker push gcr.io/google_containers/dnsutils
clean:
9 changes: 5 additions & 4 deletions test/images/entrypoint-tester/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
all: push

TAG = 0.1
PREFIX = kubernetes

all: push

ep: ep.go
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./ep.go

image: ep
sudo docker build -t kubernetes/eptest:$(TAG) .
sudo docker build -t $(PREFIX)/eptest:$(TAG) .

push: image
sudo docker push kubernetes/eptest:$(TAG)
sudo docker push $(PREFIX)/eptest:$(TAG)

clean:
rm -f ep
9 changes: 5 additions & 4 deletions test/images/goproxy/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
all: push

TAG = 0.1
PREFIX = gcr.io/google_containers

all: push

goproxy: goproxy.go
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./goproxy.go

image: goproxy
docker build -t gcr.io/google_containers/goproxy:$(TAG) .
docker build -t $(PREFIX)/goproxy:$(TAG) .

push: image
gcloud docker push gcr.io/google_containers/goproxy:$(TAG)
gcloud docker push $(PREFIX)/goproxy:$(TAG)

clean:
rm -f goproxy
15 changes: 10 additions & 5 deletions test/images/jessie-dnsutils/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
all:
@echo "try 'make image' or 'make push'"
# This image does not tag
#TAG =
PREFIX = gcr.io/google_containers

all: push

image:
docker build -t gcr.io/google_containers/jessie-dnsutils .
docker build -t $(PREFIX)/jessie-dnsutils .

push: image
gcloud docker push $(PREFIX)/jessie-dnsutils

push:
gcloud docker push gcr.io/google_containers/jessie-dnsutils
clean:
11 changes: 7 additions & 4 deletions test/images/mount-tester-user/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
all: push

TAG = 0.3
PREFIX = gcr.io/google_containers

all: push

image:
sudo docker build -t gcr.io/google_containers/mounttest-user:$(TAG) .
sudo docker build -t $(PREFIX)/mounttest-user:$(TAG) .

push: image
gcloud docker push gcr.io/google_containers/mounttest-user:$(TAG)
gcloud docker push $(PREFIX)/mounttest-user:$(TAG)

clean:
9 changes: 5 additions & 4 deletions test/images/mount-tester/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
all: push

TAG = 0.5
PREFIX = gcr.io/google_containers

all: push

mt: mt.go
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./mt.go

image: mt
sudo docker build -t gcr.io/google_containers/mounttest:$(TAG) .
sudo docker build -t $(PREFIX)/mounttest:$(TAG) .

push: image
gcloud docker push gcr.io/google_containers/mounttest:$(TAG)
gcloud docker push $(PREFIX)/mounttest:$(TAG)

clean:
rm -f mt
16 changes: 9 additions & 7 deletions test/images/network-tester/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
all: push

# Set this to the *next* version to prevent accidentally overwriting the existing image.
TAG = 1.6
PREFIX = gcr.io/google_containers

all: push

webserver: webserver.go
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./webserver.go

container: webserver
docker build -t gcr.io/google_containers/nettest:$(TAG) .
container: image

image: webserver
docker build -t $(PREFIX)/nettest:$(TAG) .

push: container
gcloud docker push gcr.io/google_containers/nettest:$(TAG)
push: image
gcloud docker push $(PREFIX)/nettest:$(TAG)

clean:
rm -f webserver
9 changes: 5 additions & 4 deletions test/images/port-forward-tester/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
all: push

TAG = 1.0
PREFIX = gcr.io/google_containers

all: push

portforwardtester: portforwardtester.go
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./portforwardtester.go

image: portforwardtester
docker build -t gcr.io/google_containers/portforwardtester:$(TAG) .
docker build -t $(PREFIX)/portforwardtester:$(TAG) .

push: image
gcloud docker push gcr.io/google_containers/portforwardtester:$(TAG)
gcloud docker push $(PREFIX)/portforwardtester:$(TAG)

clean:
rm -f portforwardtester
16 changes: 10 additions & 6 deletions test/images/porter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
#
# `make porter` will build porter.
# `make tag` will suggest a tag.
# `make container` will build a container-- you must supply a tag.
# `make push` will push the container-- you must supply a tag.
# `make image` will build an image-- you must supply a tag.
# `make push` will push the image-- you must supply a tag.

REPO ?= gcr.io/google_containers
# This image does not tag in the normal way
# TAG =
PREFIX = gcr.io/google_containers
SUGGESTED_TAG = $(shell git rev-parse --verify HEAD)

porter: porter.go
Expand All @@ -17,13 +19,15 @@ tag:
@echo "or"
@echo "$$ make push TAG=$(SUGGESTED_TAG)"

container:
container: image

image:
$(if $(TAG),,$(error TAG is not defined. Use 'make tag' after committing changes to see a suggestion))
docker build -t $(REPO)/porter:$(TAG) .
docker build -t $(PREFIX)/porter:$(TAG) .

push:
$(if $(TAG),,$(error TAG is not defined. Use 'make tag' after committing changes to see a suggestion))
gcloud docker push $(REPO)/porter:$(TAG)
gcloud docker push $(PREFIX)/porter:$(TAG)

clean:
rm -f porter
16 changes: 11 additions & 5 deletions test/images/resource-consumer/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
all: clean consumer

TAG = beta
PREFIX = gcr.io/google_containers

all: clean consumer

consumer:
CGO_ENABLED=0 godep go build -a -installsuffix cgo --ldflags '-w' -o consume-cpu/consume-cpu ./consume-cpu/consume_cpu.go
CGO_ENABLED=0 godep go build -a -installsuffix cgo --ldflags '-w' -o consumer .

container:
sudo docker build -t gcr.io/google_containers/resource_consumer:$(TAG) .
container: image

image:
sudo docker build -t $(PREFIX)/resource_consumer:$(TAG) .

run_container:
docker run --publish=8080:8080 gcr.io/google_containers/resource_consumer:$(TAG)
docker run --publish=8080:8080 $(PREFIX)/resource_consumer:$(TAG)

push:
@echo "This image is not meant to be pushed."

clean:
rm -f consumer
Expand Down
17 changes: 10 additions & 7 deletions test/images/volumes-tester/ceph/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
TAG = 0.1
PREFIX = gcr.io/google_containers

all: push

TAG = 0.1
container: image

container:
docker build -t gcr.io/google_containers/volume-ceph . # Build new image and automatically tag it as latest
docker tag gcr.io/google_containers/volume-ceph gcr.io/google_containers/volume-ceph:$(TAG) # Add the version tag to the latest image
image:
docker build -t $(PREFIX)/volume-ceph . # Build new image and automatically tag it as latest
docker tag $(PREFIX)/volume-ceph $(PREFIX)/volume-ceph:$(TAG) # Add the version tag to the latest image

push: container
gcloud docker push gcr.io/google_containers/volume-ceph # Push image tagged as latest to repository
gcloud docker push gcr.io/google_containers/volume-ceph:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag)
push: image
gcloud docker push $(PREFIX)/volume-ceph # Push image tagged as latest to repository
gcloud docker push $(PREFIX)/volume-ceph:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag)

clean:
17 changes: 10 additions & 7 deletions test/images/volumes-tester/gluster/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
TAG = 0.2
PREFIX = gcr.io/google_containers

all: push

TAG = 0.2
container: image

container:
docker build -t gcr.io/google_containers/volume-gluster . # Build new image and automatically tag it as latest
docker tag gcr.io/google_containers/volume-gluster gcr.io/google_containers/volume-gluster:$(TAG) # Add the version tag to the latest image
image:
docker build -t $(PREFIX)/volume-gluster . # Build new image and automatically tag it as latest
docker tag $(PREFIX)/volume-gluster $(PREFIX)/volume-gluster:$(TAG) # Add the version tag to the latest image

push: container
gcloud docker push gcr.io/google_containers/volume-gluster # Push image tagged as latest to repository
gcloud docker push gcr.io/google_containers/volume-gluster:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag)
push: image
gcloud docker push $(PREFIX)/volume-gluster # Push image tagged as latest to repository
gcloud docker push $(PREFIX)/volume-gluster:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag)

clean:
19 changes: 12 additions & 7 deletions test/images/volumes-tester/iscsi/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
TAG = 0.1
PREFIX = gcr.io/google_containers

all: push

TAG = 0.1
container: image

container:
image:
# Build new image and automatically tag it as latest
docker build -t gcr.io/google_containers/volume-iscsi .
docker build -t $(PREFIX)/volume-iscsi .
# Add the version tag to the latest image
docker tag gcr.io/google_containers/volume-iscsi gcr.io/google_containers/volume-iscsi:$(TAG)
docker tag $(PREFIX)/volume-iscsi $(PREFIX)/volume-iscsi:$(TAG)

block:
# Create block.tar.gz with ext2 block device with index.html inside.
Expand All @@ -15,8 +18,10 @@ block:
# Run as root!
./create_block.sh

push: container
push: image
# Push image tagged as latest to repository
gcloud docker push gcr.io/google_containers/volume-iscsi
gcloud docker push $(PREFIX)/volume-iscsi
# Push version tagged image to repository (since this image is already pushed it will simply create or update version tag)
gcloud docker push gcr.io/google_containers/volume-iscsi:$(TAG)
gcloud docker push $(PREFIX)/volume-iscsi:$(TAG)

clean:
17 changes: 10 additions & 7 deletions test/images/volumes-tester/nfs/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
TAG = 0.4
PREFIX = gcr.io/google_containers

all: push

TAG = 0.4
container: image

container:
docker build -t gcr.io/google_containers/volume-nfs . # Build new image and automatically tag it as latest
docker tag gcr.io/google_containers/volume-nfs gcr.io/google_containers/volume-nfs:$(TAG) # Add the version tag to the latest image
image:
docker build -t $(PREFIX)/volume-nfs . # Build new image and automatically tag it as latest
docker tag $(PREFIX)/volume-nfs $(PREFIX)/volume-nfs:$(TAG) # Add the version tag to the latest image

push: container
gcloud docker push gcr.io/google_containers/volume-nfs # Push image tagged as latest to repository
gcloud docker push gcr.io/google_containers/volume-nfs:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag)
push: image
gcloud docker push $(PREFIX)/volume-nfs # Push image tagged as latest to repository
gcloud docker push $(PREFIX)/volume-nfs:$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag)

clean:
19 changes: 12 additions & 7 deletions test/images/volumes-tester/rbd/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
TAG = 0.1
PREFIX = gcr.io/google_containers

all: push

TAG = 0.1
container: image

container:
image:
# Build new image and automatically tag it as latest
docker build -t gcr.io/google_containers/volume-rbd .
docker build -t $(PREFIX)/volume-rbd .
# Add the version tag to the latest image
docker tag gcr.io/google_containers/volume-rbd gcr.io/google_containers/volume-rbd:$(TAG)
docker tag $(PREFIX)/volume-rbd $(PREFIX)/volume-rbd:$(TAG)

block:
# Create block.tar.gz with ext2 block device with index.html inside.
Expand All @@ -15,8 +18,10 @@ block:
# Run as root!
./create_block.sh

push: container
push: image
# Push image tagged as latest to repository
gcloud docker push gcr.io/google_containers/volume-rbd
gcloud docker push $(PREFIX)/volume-rbd
# Push version tagged image to repository (since this image is already pushed it will simply create or update version tag)
gcloud docker push gcr.io/google_containers/volume-rbd:$(TAG)
gcloud docker push $(PREFIX)/volume-rbd:$(TAG)

clean: