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

Prep Dockerfile for building with ART tooling. #38

Merged
merged 1 commit into from
Sep 10, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"