diff --git a/bitnami/apache/.dockerigore b/bitnami/apache/.dockerigore new file mode 100644 index 000000000000..c0c6b3b3479f --- /dev/null +++ b/bitnami/apache/.dockerigore @@ -0,0 +1,3 @@ +.git +tests/ +*.md diff --git a/bitnami/apache/.gitignore b/bitnami/apache/.gitignore new file mode 100644 index 000000000000..335ec9573de5 --- /dev/null +++ b/bitnami/apache/.gitignore @@ -0,0 +1 @@ +*.tar.gz diff --git a/bitnami/apache/Dockerfile b/bitnami/apache/Dockerfile index 199a707d0a12..ee5f57b56db9 100644 --- a/bitnami/apache/Dockerfile +++ b/bitnami/apache/Dockerfile @@ -1,18 +1,21 @@ -FROM bitnami/base-ubuntu:14.04-onbuild +FROM gcr.io/stacksmith-images/ubuntu:14.04-r07 MAINTAINER Bitnami -ENV BITNAMI_APP_NAME=apache \ - BITNAMI_APP_USER=daemon \ - BITNAMI_APP_DAEMON=httpd \ - BITNAMI_APP_VERSION=2.4.18-0 \ - BITNAMI_APP_DIR=$BITNAMI_PREFIX/apache2 +ENV BITNAMI_IMAGE_VERSION=2.4.20-r0 \ + BITNAMI_APP_NAME=apache \ + BITNAMI_APP_USER=daemon -ENV BITNAMI_APP_VOL_PREFIX=/bitnami/$BITNAMI_APP_NAME \ - PATH=$BITNAMI_APP_DIR/bin:$PATH +RUN bitnami-pkg unpack apache-2.4.20-0 --checksum ec415b0938e6df70327055c5be50f80b1307b785fa5bbd04c94a4077519e5dba +RUN ln -sf /opt/bitnami/$BITNAMI_APP_NAME/htdocs /app + +ENV PATH=/opt/bitnami/$BITNAMI_APP_NAME/sbin:/opt/bitnami/$BITNAMI_APP_NAME/bin:/opt/bitnami/common/bin:$PATH -RUN $BITNAMI_PREFIX/install.sh COPY rootfs/ / +ENTRYPOINT ["/app-entrypoint.sh"] +CMD ["harpoon", "start", "--foreground", "apache"] + +VOLUME ["/bitnami/$BITNAMI_APP_NAME"] + +WORKDIR /app EXPOSE 80 443 -VOLUME ["$BITNAMI_APP_VOL_PREFIX/conf", "$BITNAMI_APP_VOL_PREFIX/logs"] -ENTRYPOINT ["/entrypoint.sh"] diff --git a/bitnami/apache/README.md b/bitnami/apache/README.md index 9ea583aec849..a97bc5365a61 100644 --- a/bitnami/apache/README.md +++ b/bitnami/apache/README.md @@ -1,39 +1,33 @@ -[![Build -Status](http://bitnami-container-builds.bitnamiapp.com/jenkins/buildStatus/icon?job=docker-apache)](http://bitnami-container-builds.bitnamiapp.com/jenkins/job/docker-apache/) +[![Build Status](http://bitnami-container-builds.bitnamiapp.com/jenkins/buildStatus/icon?job=docker-apache)](http://bitnami-container-builds.bitnamiapp.com/jenkins/job/docker-apache/) + # What is Apache? -> The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for -> modern operating systems including UNIX and Windows NT. The goal of this project is to provide a -> secure, efficient and extensible server that provides HTTP services in sync with the current HTTP -> standards. +> The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. [http://httpd.apache.org/](http://httpd.apache.org/) # TLDR ```bash -docker run --name apache bitnami/apache +docker run --name apache bitnami/apache:latest ``` ## Docker Compose -``` +```yaml apache: - image: bitnami/apache + image: bitnami/apache:latest ``` # Get this image -The recommended way to get the Bitnami Apache Docker Image is to pull the prebuilt image from the -[Docker Hub Registry](https://hub.docker.com/r/bitnami/apache). +The recommended way to get the Bitnami Apache Docker Image is to pull the prebuilt image from the [Docker Hub Registry](https://hub.docker.com/r/bitnami/apache). ```bash docker pull bitnami/apache:latest ``` -To use a specific version, you can pull a versioned tag. You can view the -[list of available versions](https://hub.docker.com/r/bitnami/apache/tags/) -in the Docker Hub Registry. +To use a specific version, you can pull a versioned tag. You can view the [list of available versions](https://hub.docker.com/r/bitnami/apache/tags/) in the Docker Hub Registry. ```bash docker pull bitnami/apache:[TAG] @@ -42,37 +36,32 @@ docker pull bitnami/apache:[TAG] If you wish, you can also build the image yourself. ```bash -git clone https://github.com/bitnami/bitnami-docker-apache.git -cd bitnami-docker-apache -docker build -t bitnami/apache . +docker build -t bitnami/apache:latest https://github.com/bitnami/bitnami-docker-apache.git ``` # Hosting a static website -This Apache image exposes a volume at `/app`. Content mounted here is served by the default -catch-all virtual host. Mounting an empty directory here will copy the default content to your -volume. +The `/app` path is configured as the Apache [DocumentRoot](https://httpd.apache.org/docs/2.4/urlmapping.html#documentroot). Content mounted here is served by the default catch-all virtual host. ```bash -docker run --name apache -v /path/to/app:/app bitnami/apache +docker run --name apache -v /path/to/app:/app bitnami/apache:latest ``` or using Docker Compose: ``` apache: - image: bitnami/apache + image: bitnami/apache:latest volumes: - /path/to/app:/app ``` # Accessing your server from the host -To access your web server from your host machine you can ask Docker to map a random port on your -host to ports `80` and `443` exposed in the container. +To access your web server from your host machine you can ask Docker to map a random port on your host to ports `80` and `443` exposed in the container. ```bash -docker run --name apache -P bitnami/apache +docker run --name apache -P bitnami/apache:latest ``` Run `docker port` to determine the random ports Docker assigned. @@ -86,54 +75,49 @@ $ docker port apache You can also manually specify the ports you want forwarded from your host to the container. ```bash -docker run -p 8080:80 -p 8443:443 bitnami/apache +docker run -p 8080:80 -p 8443:443 bitnami/apache:latest ``` -Access your web server in the browser by navigating to -[http://localhost:8080](http://localhost:8080/). +Access your web server in the browser by navigating to [http://localhost:8080](http://localhost:8080/). # Configuration ## Adding custom virtual hosts -The default httpd.conf includes virtual hosts placed in `/bitnami/apache/conf/vhosts/*.conf`. You -can mount a directory at `/bitnami/apache/conf/vhosts` from your host containing your custom virtual -hosts. +The default `httpd.conf` includes virtual hosts placed in `/bitnami/apache/conf/vhosts/*.conf`. You can mount a directory at `/bitnami/apache/conf/vhosts` from your host containing your custom virtual hosts. ```bash -docker run -v /path/to/apache/vhosts:/bitnami/apache/conf/vhosts bitnami/apache +docker run -v /path/to/apache-persistence/vhosts:/bitnami/apache/conf/vhosts bitnami/apache:latest ``` or using Docker Compose: ``` apache: - image: bitnami/apache + image: bitnami/apache:latest volumes: - - /path/to/apache/vhosts:/bitnami/apache/conf/vhosts + - /path/to/apache-persistence/vhosts:/bitnami/apache/conf/vhosts ``` ## Full configuration -This container looks for configuration in `/bitnami/apache/conf`. You can mount a directory there -with your own configuration, or the default configuration will be copied to your directory if it is -empty. +This container looks for configuration in `/bitnami/apache/conf`. You can mount a directory at `/bitnami/apache/` with your own configuration, or the default configuration will be copied to your directory at `conf/` if it is empty. ### Step 1: Run the Apache image Run the Apache image, mounting a directory from your host. ```bash -docker run --name apache -v /path/to/apache/conf:/bitnami/apache/conf bitnami/apache +docker run --name apache -v /path/to/apache-persistence:/bitnami/apache bitnami/apache:latest ``` or using Docker Compose: ``` apache: - image: bitnami/apache + image: bitnami/apache:latest volumes: - - /path/to/apache/conf:/bitnami/apache/conf + - /path/to/apache-persistence:/bitnami/apache ``` ### Step 2: Edit the configuration @@ -141,12 +125,12 @@ apache: Edit the configuration on your host using your favorite editor. ```bash -vi /path/to/apache/conf/httpd.conf +vi /path/to/apache-persistence/conf/httpd.conf ``` ### Step 4: Restart Apache -After changing the configuration, restart your Apache container for changes to take effect. +After changing the configuration, restart your Apache container for the changes to take effect. ```bash docker restart apache @@ -158,20 +142,9 @@ or using Docker Compose: docker-compose restart apache ``` -**Note!** - -You can also reload the Apache configuration by sending the `HUP` signal to the container using the -`docker kill` command. - -```bash -docker kill -s HUP apache -``` - # Reverse proxy to other containers -Apache can be used to reverse proxy to other containers using Docker's linking system. This is -particularly useful if you want to serve dynamic content through an Apache frontend. Bitnami provides -example virtual hosts for all of our runtime containers in `/bitnami/apache/conf/vhosts/`. +Apache can be used to reverse proxy to other containers using Docker's linking system. This is particularly useful if you want to serve dynamic content through an Apache frontend. **Further Reading:** @@ -179,13 +152,7 @@ example virtual hosts for all of our runtime containers in `/bitnami/apache/conf # Logging -The Bitnami Apache Docker Image supports two different logging modes: logging to stdout, and logging -to a file. - -## Logging to stdout - -The default behavior is to log to stdout, as Docker expects. These will be collected by Docker, -converted to JSON and stored in the host, to be accessible via the `docker logs` command. +The Bitnami Apache Docker image sends the container logs to the `stdout`. To view the logs: ```bash docker logs apache @@ -197,35 +164,13 @@ or using Docker Compose: docker-compose logs apache ``` -This method of logging has the downside of not being easy to manage. Without an easy way to rotate -logs, they could grow exponentially and take up large amounts of disk space on your host. - -## Logging to file - -To log to file, run the Apache image, mounting a directory from your host at `/bitnami/apache/logs`. -This will instruct the container to send logs to your directory. - -```bash -docker run --name apache -v /path/to/apache/logs:/bitnami/apache/logs bitnami/apache -``` - -or using Docker Compose: - -``` -apache: - image: bitnami/apache - volumes: - - /path/to/apache/logs:/bitnami/apache/logs -``` - -To perform operations (e.g. logrotate) on the logs, mount the same directory in a container designed -to operate on log files, such as logstash. +You can configure the containers [logging driver](https://docs.docker.com/engine/admin/logging/overview/) using the `--log-driver` option if you wish to consume the container logs differently. In the default configuration docker uses the `json-file` driver. # Maintenance ## Backing up your container -To backup your configuration and logs, follow these simple steps: +To backup your configuration, follow these simple steps: ### Step 1: Stop the currently running container @@ -241,50 +186,42 @@ docker-compose stop apache ### Step 2: Run the backup command -We need to mount two volumes in a container we will use to create the backup: a directory on your -host to store the backup in, and the volumes from the container we just stopped so we can access the -data. +We need to mount two volumes in a container we will use to create the backup: a directory on your host to store the backup in, and the volumes from the container we just stopped so we can access the data. ```bash -docker run --rm -v /path/to/backups:/backups --volumes-from apache busybox \ - cp -a /bitnami/apache /backups/latest +docker run --rm -v /path/to/apache-backups:/backups \ + --volumes-from apache busybox \ + cp -a /bitnami/apache /backups/latest ``` or using Docker Compose: ```bash -docker run --rm -v /path/to/backups:/backups --volumes-from `docker-compose ps -q apache` busybox \ - cp -a /bitnami/apache /backups/latest +docker run --rm -v /path/to/apache-backups:/backups \ + --volumes-from `docker-compose ps -q apache` busybox \ + cp -a /bitnami/apache /backups/latest ``` -**Note!** -If you only need to backup configuration, you can change the first argument to `cp` to -`/bitnami/apache/conf`. - ## Restoring a backup Restoring a backup is as simple as mounting the backup as volumes in the container. ```bash -docker run -v /path/to/backups/latest/conf:/bitnami/apache/conf \ - -v /path/to/backups/latest/logs:/bitnami/apache/logs \ - bitnami/apache +docker run -v /path/to/apache-backups/latest:/bitnami/apache bitnami/apache:latest ``` or using Docker Compose: ``` apache: - image: bitnami/apache + image: bitnami/apache:latest volumes: - - /path/to/backups/latest/conf:/bitnami/apache/conf - - /path/to/backups/latest/logs:/bitnami/apache/logs + - /path/to/apache-backups/latest:/bitnami/apache ``` ## Upgrade this image -Bitnami provides up-to-date versions of Apache, including security patches, soon after they are made -upstream. We recommend that you follow these steps to upgrade your container. +Bitnami provides up-to-date versions of Apache, including security patches, soon after they are made upstream. We recommend that you follow these steps to upgrade your container. ### Step 1: Get the updated image @@ -315,8 +252,7 @@ docker-compose rm -v apache ### Step 4: Run the new image -Re-create your container from the new image, [restoring your backup](#restoring-a-backup) if -necessary. +Re-create your container from the new image, [restoring your backup](#restoring-a-backup) if necessary. ```bash docker run --name apache bitnami/apache:latest @@ -330,38 +266,36 @@ docker-compose start apache # Testing -This image is tested for expected runtime behavior, using the -[Bats](https://github.com/sstephenson/bats) testing framework. You can run the tests on your machine -using the `bats` command. +This image is tested for expected runtime behavior, using the [Bats](https://github.com/sstephenson/bats) testing framework. You can run the tests on your machine using the `bats` command. ``` bats test.sh ``` -# Changelog +# Notable Changes -## 2.4.12-4-r01 (2015-10-05) +## 2.4.18-r0 -- `/app` directory is no longer exported as a volume. This caused problems when building on top of the image, since changes in the volume are not persisted between Dockerfile `RUN` instructions. To keep the previous behavior (so that you can mount the volume in another container), create the container with the `-v /app` option. +- All volumes have been merged at `/bitnami/apache`. Now you only need to mount a single volume at `/bitnami/apache` for persistence. +- The logs are always sent to the `stdout` and are no longer collected in the volume. + +## 2.4.12-4-r01 + +- The `/app` directory is no longer exported as a volume. This caused problems when building on top of the image, since changes in the volume are not persisted between Dockerfile `RUN` instructions. To keep the previous behavior (so that you can mount the volume in another container), create the container with the `-v /app` option. # Contributing -We'd love for you to contribute to this container. You can request new features by creating an -[issue](https://github.com/bitnami/bitnami-docker-apache/issues), or submit a -[pull request](https://github.com/bitnami/bitnami-docker-apache/pulls) with your contribution. +We'd love for you to contribute to this container. You can request new features by creating an [issue](https://github.com/bitnami/bitnami-docker-apache/issues), or submit a [pull request](https://github.com/bitnami/bitnami-docker-apache/pulls) with your contribution. # Issues -If you encountered a problem running this container, you can file an -[issue](https://github.com/bitnami/bitnami-docker-apache/issues). For us to provide better support, -be sure to include the following information in your issue: +If you encountered a problem running this container, you can file an [issue](https://github.com/bitnami/bitnami-docker-apache/issues). For us to provide better support, be sure to include the following information in your issue: - Host OS and version - Docker version (`docker version`) - Output of `docker info` - Version of this container (`echo $BITNAMI_APP_VERSION` inside the container) -- The command you used to run the container, and any relevant output you saw (masking any sensitive -information) +- The command you used to run the container, and any relevant output you saw (masking any sensitive information) # License diff --git a/bitnami/apache/help.txt b/bitnami/apache/help.txt deleted file mode 100644 index d92d702299b9..000000000000 --- a/bitnami/apache/help.txt +++ /dev/null @@ -1,21 +0,0 @@ - $BITNAMI_APP_NAME cheatsheet: - - VOLUMES: - /app: Location of static files to be served. - $BITNAMI_APP_VOL_PREFIX/conf: Location of vhosts directory and general $BITNAMI_APP_NAME configuration files. - $BITNAMI_APP_VOL_PREFIX/logs: Location of access and error logs. - - PORTS: - 80: Default http port. - 443: Default https port. - - MISC: - Tip: By mounting the $BITNAMI_APP_VOL_PREFIX/conf directory from the host, changing virtual host configuration is as easy as adding appropriate files from the host to the vhosts directory. - - COMMANDS: - print-help: Print this page. - check-updates: Check if a new version of the $BITNAMI_APP_NAME image is available. - - Visit $GITHUB_PAGE for more information. - - diff --git a/bitnami/apache/help.yaml b/bitnami/apache/help.yaml deleted file mode 100644 index 2b65c208bc6d..000000000000 --- a/bitnami/apache/help.yaml +++ /dev/null @@ -1,9 +0,0 @@ -volumes: - /app: "Location of static files to be served." - $BITNAMI_APP_VOL_PREFIX/conf: "Location of vhosts directory and general $BITNAMI_APP_NAME configuration files." - $BITNAMI_APP_VOL_PREFIX/logs: "Location of access and error logs." -ports: - 80: "Default http port." - 443: "Default https port." -misc: - Tip: "By mounting the $BITNAMI_APP_VOL_PREFIX/conf directory from the host, changing virtual host configuration is as easy as adding appropriate files from the host to the vhosts directory." diff --git a/bitnami/apache/installer.run.sha256 b/bitnami/apache/installer.run.sha256 deleted file mode 100644 index 2e0916570897..000000000000 --- a/bitnami/apache/installer.run.sha256 +++ /dev/null @@ -1 +0,0 @@ -4d0bbe22e61faf10cfe084f9702427417c94a70b0f1d510c98f58807adc50a45 /tmp/installer.run \ No newline at end of file diff --git a/bitnami/apache/post-install.sh b/bitnami/apache/post-install.sh deleted file mode 100644 index a916d26403f3..000000000000 --- a/bitnami/apache/post-install.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -cd $BITNAMI_APP_DIR - -# Backup default conf/htdocs -mv conf conf.defaults -mv htdocs htdocs.defaults - -# Create an empty htdocs directory -mkdir $BITNAMI_APP_DIR/htdocs - -# Setup mount point symlinks -ln -s $BITNAMI_APP_DIR/conf $BITNAMI_APP_VOL_PREFIX/conf -ln -s $BITNAMI_APP_DIR/logs $BITNAMI_APP_VOL_PREFIX/logs -ln -s $BITNAMI_APP_DIR/htdocs /app - -# Log to stdout -ln -sf /dev/stdout logs/access_log -ln -sf /dev/stderr logs/error_log diff --git a/bitnami/apache/rootfs/app-entrypoint.sh b/bitnami/apache/rootfs/app-entrypoint.sh new file mode 100755 index 000000000000..905cfc564351 --- /dev/null +++ b/bitnami/apache/rootfs/app-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e + +if [[ "$1" == "harpoon" && "$2" == "start" ]]; then + status=`harpoon inspect $BITNAMI_APP_NAME` + if [[ "$status" == *'"lifecycle": "unpacked"'* ]]; then + harpoon initialize $BITNAMI_APP_NAME + fi + chown -R :$BITNAMI_APP_USER /bitnami/$BITNAMI_APP_NAME || true +fi + +exec /entrypoint.sh "$@" diff --git a/bitnami/apache/rootfs/etc/cont-init.d/01-bitnami-apache b/bitnami/apache/rootfs/etc/cont-init.d/01-bitnami-apache deleted file mode 100755 index e2c5d0d62f85..000000000000 --- a/bitnami/apache/rootfs/etc/cont-init.d/01-bitnami-apache +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/with-contenv bash -set -e -source $BITNAMI_PREFIX/bitnami-utils.sh - -generate_conf_files - -if [ ! "$(ls -A /app)" ]; then - cp -r $BITNAMI_APP_DIR/htdocs.defaults/* $BITNAMI_APP_DIR/htdocs -fi - -chown -R :$BITNAMI_APP_USER $BITNAMI_APP_DIR/htdocs diff --git a/bitnami/apache/rootfs/etc/services.d/apache/finish b/bitnami/apache/rootfs/etc/services.d/apache/finish deleted file mode 100755 index 9f54f1ccfc16..000000000000 --- a/bitnami/apache/rootfs/etc/services.d/apache/finish +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/with-contenv bash - -failcount=0 -if [ -f $BITNAMI_APP_DIR/tmp/failcount ]; then - failcount=$(cat $BITNAMI_APP_DIR/tmp/failcount) -fi - -start=$(cat $BITNAMI_APP_DIR/tmp/start) -stop=`date '+%d%H%M%S'` -interval=`expr $stop - $start` -if test $interval -lt 30 ; then - failcount=`expr $failcount + 1` -else - failcount=0 -fi -echo -n $failcount > $BITNAMI_APP_DIR/tmp/failcount - -# bring down container on frequent failures. something is definitely wrong -if test $failcount -ge 3 ; then - s6-svscanctl -t /var/run/s6/services -fi diff --git a/bitnami/apache/rootfs/etc/services.d/apache/run b/bitnami/apache/rootfs/etc/services.d/apache/run deleted file mode 100755 index fe0cdb01127f..000000000000 --- a/bitnami/apache/rootfs/etc/services.d/apache/run +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/with-contenv bash -set -e -source $BITNAMI_PREFIX/bitnami-utils.sh - -# Remove zombie pidfile -rm -f $BITNAMI_APP_DIR/logs/httpd.pid - -mkdir -p $BITNAMI_APP_DIR/tmp -date '+%d%H%M%S' > $BITNAMI_APP_DIR/tmp/start -exec $BITNAMI_APP_DAEMON -DFOREGROUND -f $BITNAMI_APP_DIR/conf/httpd.conf ${EXTRA_OPTIONS:+"$EXTRA_OPTIONS"} diff --git a/bitnami/apache/rootfs/opt/bitnami/apache2/conf.defaults/vhosts/node.conf.example b/bitnami/apache/rootfs/opt/bitnami/apache2/conf.defaults/vhosts/node.conf.example deleted file mode 100644 index c115c1986904..000000000000 --- a/bitnami/apache/rootfs/opt/bitnami/apache2/conf.defaults/vhosts/node.conf.example +++ /dev/null @@ -1,11 +0,0 @@ - - ServerName yourapp.com - DocumentRoot "/app" - ProxyPass / http://[your_node_container_link_alias]:3000 - ProxyPassReverse / http://[your_node_container_link_alias]:3000 - - Options Indexes FollowSymLinks - AllowOverride All - Require all granted - - diff --git a/bitnami/apache/rootfs/opt/bitnami/apache2/conf.defaults/vhosts/php-fpm.conf.example b/bitnami/apache/rootfs/opt/bitnami/apache2/conf.defaults/vhosts/php-fpm.conf.example deleted file mode 100644 index 02b8e40a9b72..000000000000 --- a/bitnami/apache/rootfs/opt/bitnami/apache2/conf.defaults/vhosts/php-fpm.conf.example +++ /dev/null @@ -1,10 +0,0 @@ - - ServerName yourapp.com - DocumentRoot "/app" - ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://[your_php-fpm_container_link_alias]:9000/app/$1 - - Options Indexes FollowSymLinks - AllowOverride All - Require all granted - - diff --git a/bitnami/apache/rootfs/opt/bitnami/apache2/conf.defaults/vhosts/ruby.conf.example b/bitnami/apache/rootfs/opt/bitnami/apache2/conf.defaults/vhosts/ruby.conf.example deleted file mode 100644 index 679ef46edd46..000000000000 --- a/bitnami/apache/rootfs/opt/bitnami/apache2/conf.defaults/vhosts/ruby.conf.example +++ /dev/null @@ -1,11 +0,0 @@ - - ServerName yourapp.com - DocumentRoot "/app" - ProxyPass / http://[your_ruby_container_link_alias]:3000 - ProxyPassReverse / http://[your_ruby_container_link_alias]:3000 - - Options Indexes FollowSymLinks - AllowOverride All - Require all granted - - diff --git a/bitnami/apache/test.sh b/bitnami/apache/test.sh index 985382c2ea01..df3c04f20efd 100644 --- a/bitnami/apache/test.sh +++ b/bitnami/apache/test.sh @@ -2,14 +2,13 @@ # source the helper script APP_NAME=apache -VOL_PREFIX=/bitnami/$APP_NAME -VOLUMES=/app:$VOL_PREFIX/conf:$VOL_PREFIX/logs -SLEEP_TIME=2 +VOLUMES=/bitnami/$APP_NAME +SLEEP_TIME=20 load tests/docker_helper # Cleans up all running/stopped containers and host mounted volumes cleanup_environment() { - container_remove_full default + container_remove default } # Teardown called at the end of each test @@ -55,15 +54,6 @@ cleanup_environment [[ "$output" =~ "GET / HTTP/1.1" ]] } -@test "All the volumes exposed" { - container_create default -d - - # inspect container to check if volumes are exposed - run container_inspect default --format {{.Mounts}} - [[ "$output" =~ "$VOL_PREFIX/logs" ]] - [[ "$output" =~ "$VOL_PREFIX/conf" ]] -} - @test "Vhosts directory is imported" { # create container and exposing TCP port 81 container_create default -d --expose 81 @@ -74,8 +64,7 @@ Listen 81 ServerName default Redirect 405 / - -EOF" +" # restart the container for the vhost config to take effect container_restart default @@ -84,36 +73,3 @@ EOF" run curl_client default -i http://$APP_NAME:81 [[ "$output" =~ "405 Method Not Allowed" ]] } - -@test "Configuration changes are preserved after deletion" { - container_create_with_host_volumes default -d - - # edit httpd.conf - container_exec default sed -i 's|^[#]*[ ]*LogLevel \+.*|LogLevel debug|' $VOL_PREFIX/conf/httpd.conf - container_exec default sed -i 's|^[#]*[ ]*ServerSignature \+.*|ServerSignature On|' $VOL_PREFIX/conf/httpd.conf - container_exec default sed -i 's|^[#]*[ ]*EnableSendfile \+.*|EnableSendfile Off|' $VOL_PREFIX/conf/httpd.conf - - # add vhost - container_exec default sh -c "cat > $VOL_PREFIX/conf/vhosts/test.conf < - ServerName default - Redirect 405 / - -EOF" - - # stop and remove container - container_remove default - - # relaunch container with host volumes - container_create_with_host_volumes default -d - - run container_exec default cat $VOL_PREFIX/conf/httpd.conf - [[ "$output" =~ "LogLevel debug" ]] - [[ "$output" =~ "ServerSignature On" ]] - [[ "$output" =~ "EnableSendfile Off" ]] - - run container_exec default cat $VOL_PREFIX/conf/vhosts/test.conf - [[ "$output" =~ "ServerName default" ]] - [[ "$output" =~ "Redirect 405 /" ]] -}