Skip to content

Commit

Permalink
Merge pull request #38 from dgoodwin/art-dockerfile-updates
Browse files Browse the repository at this point in the history
Prep Dockerfile for building with ART tooling.
  • Loading branch information
paulfantom authored Sep 10, 2018
2 parents 57db36f + bc6e185 commit 7957e91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions cmd/machine-controller/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@

# Reproducible builder image
FROM openshift/origin-release:golang-1.10 as builder

# Workaround a bug in imagebuilder (some versions) where this dir will not be auto-created.
RUN mkdir -p /go/src/sigs.k8s.io/cluster-api-provider-aws
WORKDIR /go/src/sigs.k8s.io/cluster-api-provider-aws

# This expects that the context passed to the docker build command is
# the cluster-api-provider-aws directory.
# e.g. docker build -t <tag> -f <this_Dockerfile> <path_to_cluster-api-aws>
COPY . .
COPY . .

RUN CGO_ENABLED=0 GOOS=linux go install -a -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/machine-controller
RUN GOPATH="/go" CGO_ENABLED=0 GOOS=linux go install -a -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/machine-controller

# Final container
FROM openshift/origin-base
Expand Down
4 changes: 2 additions & 2 deletions cmd/machine-controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ NAME = aws-machine-controller
TAG = 0.0.1

image:
imagebuilder -t "$(PREFIX)/$(NAME):$(TAG)" -f ./Dockerfile ../..
imagebuilder -t "$(PREFIX)/$(NAME):$(TAG)" -f ../../Dockerfile ../..

push: image
docker push "$(PREFIX)/$(NAME):$(TAG)"
Expand All @@ -32,7 +32,7 @@ fix_gcs_permissions:
gsutil -m acl ch -r -u AllUsers:READ gs://artifacts.$(GCR_BUCKET).appspot.com

dev_image:
docker build -t "$(DEV_PREFIX)/$(NAME):$(TAG)-dev" -f ./Dockerfile ../..
docker build -t "$(DEV_PREFIX)/$(NAME):$(TAG)-dev" -f ../../Dockerfile ../..

dev_push: dev_image
docker push "$(DEV_PREFIX)/$(NAME):$(TAG)-dev"

0 comments on commit 7957e91

Please sign in to comment.