Permalink
Find file
executable file 45 lines (37 sloc) 2.05 KB
#!/bin/bash
#
###########################################################################
# (C) Copyright IBM Corporation 2016. #
# #
# 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. #
###########################################################################
if [ $# != 3 ]; then
echo "Usage: build <version> <IBMid> <IBMid password>"
exit 1
fi
VERSION=$1
IBM_ID=$2
IBM_PASSWORD=$3
# Build Installation Manager image
docker build -t installation-manager im || exit $?
# Install WAS with IM and export as tar file
docker run --rm -v $(pwd):/host:Z installation-manager /host/install_was $VERSION $IBM_ID $IBM_PASSWORD || exit $?
# Host tar file on HTTP server
docker run -d --name tar_server -v $(pwd)/was-${VERSION}.tar.gz:/host/was-${VERSION}.tar.gz -w /host python:2-slim python -m SimpleHTTPServer
tar_server_ip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' tar_server)
tar_url="http://${tar_server_ip}:8000/was-${VERSION}.tar.gz"
# Build install image from hosted tar file
docker build -t websphere-traditional:install --build-arg TAR_URL=$tar_url install || exit $?
docker rm -f tar_server
# Build profile image
docker build -t websphere-traditional:profile profile || exit $?