From a857929d2c737363de3f7bc7ec8ff7095ed2d9a1 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Mon, 13 Feb 2017 18:11:17 +0530 Subject: [PATCH 1/2] config: move default config var to Dockerfile --- bitnami/opencart/Dockerfile | 9 +++++++++ bitnami/opencart/rootfs/app-entrypoint.sh | 10 ---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/bitnami/opencart/Dockerfile b/bitnami/opencart/Dockerfile index e02c12df299f..72d0f5d624d8 100644 --- a/bitnami/opencart/Dockerfile +++ b/bitnami/opencart/Dockerfile @@ -20,6 +20,15 @@ RUN bitnami-pkg unpack opencart-2.3.0.2-3 --checksum 92e9d059beff6cea9df091cc197 COPY rootfs / +ENV APACHE_HTTP_PORT="80" \ + APACHE_HTTPS_PORT="443" \ + OPENCART_USERNAME="user" \ + OPENCART_PASSWORD="bitnami1" \ + OPENCART_EMAIL="user@example.com" \ + MARIADB_USER="root" \ + MARIADB_HOST="mariadb" \ + MARIADB_PORT="3306" + VOLUME ["/bitnami/opencart", "/bitnami/apache", "/bitnami/php"] EXPOSE 80 443 diff --git a/bitnami/opencart/rootfs/app-entrypoint.sh b/bitnami/opencart/rootfs/app-entrypoint.sh index 79104b9e6589..6502039754c5 100755 --- a/bitnami/opencart/rootfs/app-entrypoint.sh +++ b/bitnami/opencart/rootfs/app-entrypoint.sh @@ -14,16 +14,6 @@ function initialize { fi } -# Set default values -export APACHE_HTTP_PORT=${APACHE_HTTP_PORT:-"80"} -export APACHE_HTTPS_PORT=${APACHE_HTTPS_PORT:-"443"} -export OPENCART_USERNAME=${OPENCART_USERNAME:-"user"} -export OPENCART_PASSWORD=${OPENCART_PASSWORD:-"bitnami1"} -export OPENCART_EMAIL=${OPENCART_EMAIL:-"user@example.com"} -export MARIADB_USER=${MARIADB_USER:-"root"} -export MARIADB_HOST=${MARIADB_HOST:-"mariadb"} -export MARIADB_PORT=${MARIADB_PORT:-"3306"} - if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/init.sh" ]]; then for module in apache php opencart; do initialize $module From fc368cd054395662526faa904b6cadefd8af47fa Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Mon, 13 Feb 2017 18:11:19 +0530 Subject: [PATCH 2/2] entrypoint: remove references to `entrypoint.sh` from base image --- bitnami/opencart/Dockerfile | 2 +- bitnami/opencart/rootfs/app-entrypoint.sh | 29 +++++++---------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/bitnami/opencart/Dockerfile b/bitnami/opencart/Dockerfile index 72d0f5d624d8..14a6087e29fb 100644 --- a/bitnami/opencart/Dockerfile +++ b/bitnami/opencart/Dockerfile @@ -1,4 +1,4 @@ -FROM gcr.io/stacksmith-images/minideb:jessie-r8 +FROM gcr.io/stacksmith-images/minideb:jessie-r9 MAINTAINER Bitnami diff --git a/bitnami/opencart/rootfs/app-entrypoint.sh b/bitnami/opencart/rootfs/app-entrypoint.sh index 6502039754c5..5efd3cd45c74 100755 --- a/bitnami/opencart/rootfs/app-entrypoint.sh +++ b/bitnami/opencart/rootfs/app-entrypoint.sh @@ -1,24 +1,13 @@ -#!/bin/bash -set -e +#!/bin/bash -e +. /opt/bitnami/base/functions +. /opt/bitnami/base/helpers -function initialize { - # Package can be "installed" or "unpacked" - status=`nami inspect $1` - if [[ "$status" == *'"lifecycle": "unpacked"'* ]]; then - # Clean up inputs - inputs="" - if [[ -f /$1-inputs.json ]]; then - inputs=--inputs-file=/$1-inputs.json - fi - nami initialize $1 $inputs - fi -} +print_welcome_page +check_for_updates & -if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/init.sh" ]]; then - for module in apache php opencart; do - initialize $module - done - echo "Starting application ..." +if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/init.sh" ]]; then + nami_initialize apache php opencart + info "Starting opencart..." fi -exec /entrypoint.sh "$@" +exec tini -- "$@"