Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Introducing wso2base image with minimum packages installed #46

Merged
merged 1 commit into from
Jun 24, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 14 additions & 14 deletions common/provision/puppet/image-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ echo "environment=${FACTER_environment}"
echo "platform=${FACTER_platform}"
echo "vm_type=${FACTER_vm_type}"

# Prep puppet
# Prepare Puppet
mkdir -p /etc/puppet
pushd /etc/puppet > /dev/null
apt-get update && apt-get install -y wget puppet iproute2

# Add wso2user
getent group wso2 > /dev/null 2>&1 || addgroup wso2
id -u wso2user > /dev/null 2>&1 || adduser --system --shell /bin/bash --gecos 'WSO2User' --ingroup wso2 --disabled-login wso2user

# WGET and install puppet modules
wget -nH -e robots=off --reject "index.html*" -nv ${HTTP_PACK_SERVER}/hiera.yaml
wget -rnH --level=0 -e robots=off --reject "index.html*" -nv ${HTTP_PACK_SERVER}/hieradata/
wget -rnH --level=0 -e robots=off --reject "index.html*" -nv ${HTTP_PACK_SERVER}/manifests/
wget -rnH --level=0 -e robots=off --reject "index.html*" -nv ${HTTP_PACK_SERVER}/modules/wso2base/
wget -rnH --level=0 -e robots=off --reject "index.html*" -nv ${HTTP_PACK_SERVER}/modules/${WSO2_SERVER}/
puppet module install puppetlabs/stdlib
puppet module install 7terminals-java
# Download Puppet modules and Hiera files via local Python HTTP server
echo "Downloading Puppet modules and Hiera data..."
wget -q -nv -rnH -e robots=off --reject "index.html*" ${HTTP_PACK_SERVER}/hiera.yaml
wget -q -nv -rnH --level=0 -e robots=off --reject "index.html*" ${HTTP_PACK_SERVER}/hieradata/
wget -q -nv -rnH --level=0 -e robots=off --reject "index.html*" ${HTTP_PACK_SERVER}/manifests/
wget -q -nv -rnH --level=0 -e robots=off --reject "index.html*" ${HTTP_PACK_SERVER}/modules/wso2base/
wget -q -nv -rnH --level=0 -e robots=off --reject "index.html*" ${HTTP_PACK_SERVER}/modules/${WSO2_SERVER}/

# puppet apply
# Run Puppet agent in stand-alone mode
echo "Running Puppet agent..."
puppet apply -e "include ${WSO2_SERVER}" --hiera_config=/etc/puppet/hiera.yaml

# Cleanup
apt-get purge -y --auto-remove puppet wget
rm -rfv /etc/puppet/*
rm -rfv /var/lib/apt/lists/*
echo "Cleaning up packages and files no longer required..."
apt-get purge -y --auto-remove puppet wget zip unzip
rm -rf /etc/puppet/*
rm -rf /var/lib/apt/lists/*
chown wso2user:wso2 /usr/local/bin/*
chown -R wso2user:wso2 /mnt
popd > /dev/null
2 changes: 1 addition & 1 deletion wso2am/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------

FROM ubuntu:latest
FROM wso2/wso2base:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive
Expand Down
2 changes: 1 addition & 1 deletion wso2as/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------

FROM ubuntu:latest
FROM wso2/wso2base:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive
Expand Down
26 changes: 26 additions & 0 deletions wso2base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ------------------------------------------------------------------------
#
# Copyright 2016 WSO2, Inc. (http://wso2.com)
#
# 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 ubuntu:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends wget puppet iproute2 zip unzip && \
puppet module install puppetlabs/stdlib && \
puppet module install 7terminals-java
26 changes: 26 additions & 0 deletions wso2base/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# ------------------------------------------------------------------------
#
# Copyright 2016 WSO2, Inc. (http://wso2.com)
#
# 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

# ------------------------------------------------------------------------

set -e

self_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source "${self_path}/../common/scripts/base.sh"

echoBold "Building docker base image..."
docker build -t wso2/wso2base ${self_path}
2 changes: 1 addition & 1 deletion wso2bps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------

FROM ubuntu:latest
FROM wso2/wso2base:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive
Expand Down
2 changes: 1 addition & 1 deletion wso2brs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------

FROM ubuntu:latest
FROM wso2/wso2base:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive
Expand Down
2 changes: 1 addition & 1 deletion wso2cep/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------

FROM ubuntu:latest
FROM wso2/wso2base:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive
Expand Down
2 changes: 1 addition & 1 deletion wso2das/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------

FROM ubuntu:latest
FROM wso2/wso2base:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive
Expand Down
2 changes: 1 addition & 1 deletion wso2dss/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------

FROM ubuntu:latest
FROM wso2/wso2base:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive
Expand Down
2 changes: 1 addition & 1 deletion wso2es/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------

FROM ubuntu:latest
FROM wso2/wso2base:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive
Expand Down
2 changes: 1 addition & 1 deletion wso2esb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------

FROM ubuntu:latest
FROM wso2/wso2base:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive
Expand Down
2 changes: 1 addition & 1 deletion wso2greg/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------

FROM ubuntu:latest
FROM wso2/wso2base:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive
Expand Down
2 changes: 1 addition & 1 deletion wso2is/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------

FROM ubuntu:latest
FROM wso2/wso2base:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive
Expand Down
2 changes: 1 addition & 1 deletion wso2mb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# ------------------------------------------------------------------------

FROM ubuntu:latest
FROM wso2/wso2base:latest
MAINTAINER dev@wso2.org

ENV DEBIAN_FRONTEND noninteractive
Expand Down