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

Make hostnet-nginx test images multi-arch #313

Merged
merged 1 commit into from
May 24, 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
6 changes: 3 additions & 3 deletions images/hostnet-nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM nginx
ARG PORT
RUN sed -i "s/listen\s*80;/listen ${PORT};/g" /etc/nginx/conf.d/default.conf
ARG ARCH
FROM $ARCH/nginx
COPY default.conf /etc/nginx/conf.d/default.conf
21 changes: 17 additions & 4 deletions images/hostnet-nginx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.

.PHONY: all
include ../../hack/make-rules/Makefile.manifest
include ../../hack/make-rules/BASEIMAGES

all: hostnet-nginx
.PHONY: all push-manifest

REGISTRY = gcr.io/cri-tools
ALL_ARCH = amd64 arm64 ppc64le s390x
TAG = latest
IMAGES_LIST = hostnet-nginx
PORT=12003

all: hostnet-nginx push-manifest

hostnet-nginx:
docker build . -t gcr.io/cri-tools/$@ --build-arg PORT=12003
gcloud docker -- push gcr.io/cri-tools/$@
sed -i "s/listen\s*80;/listen ${PORT};/g" default.conf
$(foreach arch,$(ALL_ARCH),docker build . -t $(REGISTRY)/$@-$(arch) --build-arg ARCH=$($(arch));)
$(foreach arch,$(ALL_ARCH),docker push $(REGISTRY)/$@-$(arch);)

push-manifest: manifest-tool
$(foreach image,$(IMAGES_LIST),manifest-tool push from-args --platforms $(call join_platforms,$(ALL_ARCH)) --template $(REGISTRY)/$(image)-ARCH:$(TAG) --target $(REGISTRY)/$(image):$(TAG);)
45 changes: 45 additions & 0 deletions images/hostnet-nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
server {
listen 80;
server_name localhost;

#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}