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

Add support for alpine-based image #70

Merged
merged 1 commit into from
Nov 16, 2016
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
12 changes: 12 additions & 0 deletions nginx-controller/DockerfileForAlpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM nginx:1.11.5-alpine

# forward nginx access and error logs to stdout and stderr of the ingress
# controller process
RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \
&& ln -sf /proc/1/fd/2 /var/log/nginx/error.log

COPY nginx-ingress nginx/ingress.tmpl nginx/nginx.conf.tmpl /

RUN rm /etc/nginx/conf.d/*

ENTRYPOINT ["/nginx-ingress"]
3 changes: 2 additions & 1 deletion nginx-controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PREFIX = nginxdemos/nginx-ingress

DOCKER_RUN = docker run --rm -v $(shell pwd)/../:/go/src/github.com/nginxinc/kubernetes-ingress -w /go/src/github.com/nginxinc/kubernetes-ingress/nginx-controller/
GOLANG_CONTAINER = golang:1.6
DOCKERFILE = Dockerfile

BUILD_IN_CONTAINER = 1
PUSH_TO_GCR =
Expand All @@ -29,7 +30,7 @@ else
endif

container: test nginx-ingress
docker build -t $(PREFIX):$(TAG) .
docker build -f $(DOCKERFILE) -t $(PREFIX):$(TAG) .

push: container
$(GCLOUD) docker push $(PREFIX):$(TAG)
Expand Down
5 changes: 4 additions & 1 deletion nginx-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ The **Makefile** contains the following main variables, which you should customi
* **VERSION** -- the current version of the controller.
* **TAG** -- the tag added to the image. It's set to the value of the `VERSION` variable by default.
* **PUSH_TO_GCR**. If you’re running your Kubernetes in GCE and using Google Container Registry, make sure that `PUSH_TO_GCR = 1`. This means using the `gcloud docker push` command to push the image, which is convenient when pushing images to GCR. By default, the variable is unset and the regular `docker push` command is used to push the image to the registry.
* **DOCKERFILE** -- the path to a Dockerfile. We provide two Dockerfiles:
1. `Dockerfile`, for building a debian-based image. It's used by default.
1. `DockerfileForAlpine`, for building an alpine-based image.

Let’s create the controller binary, build an image and push the image to the private registry. Make sure to run the `docker login` command first to login to the registry. If you’re using Google Container Registry, as we are in our example here, you don’t need to use the docker command to login. However, make sure you’re logged into the gcloud tool (using the `gcloud auth login` command).
Let’s create the controller binary, build an image and push the image to the private registry. Make sure to run the `docker login` command first to login to the registry. If you’re using Google Container Registry, as we are in our example here, you don’t need to use the docker command to login. However, make sure you’re logged into the gcloud tool (using the `gcloud auth login` command).

In this folder we run the following commands in the shell:
```
Expand Down