Commit 208b217e authored by Atte's avatar Atte

Modified containerization to different image and to run as non-root user. Now...

Modified containerization to different image and to run as non-root user. Now also OpenShift compatible.
parent 4c99b2f6
# Copyright 2018 CSC - IT Center for Science
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM centos/httpd-24-centos7
USER root
# add wget, zip and httpd. gzip, curl, tar are there by default
RUN yum update -y \
&& yum install -y zip wget
ARG SERVERROOT=/var/www/html
ARG CGIBIN=/var/www/cgi-bin
# copy NOMAD webservices
COPY ./htdocs/NOMAD/ $SERVERROOT/htdocs/NOMAD/
COPY ./cgi-bin/NOMAD/ $CGIBIN/NOMAD/
# copy NOMAD username and password
COPY ./pass $CGIBIN/../
USER 1001
# Overview of container set up
* install Docker
* add your NOMAD username and password in webserver/pass
* build container
```
sudo docker build -t nomadvr .
```
* run container
```
sudo docker run -d -p 8080:8080 nomadvr
```
* Test e.g. with
```
http://you.rip.add.res:8080/cgi-bin/NOMAD/material?109702
```
* the json files in the zip should not be zero size, if they are, it's likely authentication issue
* stop container
```
sudo docker stop
```
......@@ -7,6 +7,7 @@ Directories:
Files:
Readme.md: This document
Readme-containerization.md: Quick info on how to set up servives in container.
pass: Information on the NOMAD user under which the data is accessed.
cgi-bin/NOMAD/material:
......@@ -46,4 +47,4 @@ Prerequisites:
-grep
-zip
-wget
-curl
\ No newline at end of file
-curl
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment