Skip to content

Commit

Permalink
Merge pull request #313 from nitkon/master
Browse files Browse the repository at this point in the history
Make hostnet-nginx test images multi-arch
  • Loading branch information
feiskyer authored May 24, 2018
2 parents e24104e + 49c8e70 commit 36ee1b4
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 7 deletions.
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;
#}
}

0 comments on commit 36ee1b4

Please sign in to comment.