Skip to content

TIDO-505 Update base image #3

merged 9 commits into from Aug 27, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Replace CentOS7 sample app image with official PHP image
dmartinez committed Aug 20, 2024
commit 69b71d64c36d2a01f12cf23ca2b96c5f84dc36cd
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,6 +1,6 @@
FROM i2incommon/shibboleth_sp:3.4.1_05152024_rocky9_multiarch

LABEL version="0.0.2"
LABEL version="${VERSION}"

RUN dnf update -y && \
dnf clean all
38 changes: 38 additions & 0 deletions Makefile
@@ -0,0 +1,38 @@
# This is the main interface into the repository for building the image of the Shibboleth SP reverse proxy.
#
# All targets assume they're running on a Linux or macOS host with Bash and Docker installed.
# Any other dependencies should be satisfied by containers.
#

.DEFAULT_GOAL := help

DEBUG = [DEBUG]
INFO = [INFO]
SUCCESS = [INFO]

VERSION := $(shell cat VERSION.txt)

compose := docker compose

.PHONY: all
all: build

.PHONY: build
build: ## Build the Docker image
VERSION=latest $(compose) build proxy
@echo "$(SUCCESS) Successfully built!"

.PHONY: clean
clean: ## Remove build artifacts
@echo "This is where we clean everything!"

.PHONY: help
help: ## Display this help (default)
@echo "Targets:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf " %-17s%s\n", $$1, $$2}'

.PHONY: release
release: ## Build the Docker image
VERSION=${VERSION} $(compose) build proxy
@echo "$(SUCCESS) Successfully built!"
1 change: 1 addition & 0 deletions VERSION.txt
@@ -0,0 +1 @@
0.0.2
15 changes: 0 additions & 15 deletions ci/build.sh

This file was deleted.

12 changes: 6 additions & 6 deletions tests/docker-compose.yml → docker-compose.yml
@@ -10,19 +10,19 @@ services:

app:
build:
context: "./containers/app"
context: "./tests/containers/app"
networks:
- app-proxy

data:
build:
context: "./containers/ldap"
context: "./tests/containers/ldap"
networks:
- data-idp

idp:
build:
context: "./containers/idp"
context: "./tests/containers/idp"
depends_on:
- data
networks:
@@ -38,8 +38,8 @@ services:

proxy:
build:
context: ".."
image: shib-proxy:${PROXY_IMAGE_TAG}
context: "."
image: shib-proxy
ports:
- "8443:8443"
environment:
@@ -281,7 +281,7 @@ services:

test:
build:
context: "./containers/test"
context: "./tests/containers/test"
networks:
- idp-test
- proxy-test
21 changes: 4 additions & 17 deletions tests/containers/app/Dockerfile
@@ -1,17 +1,4 @@
# Application Container
FROM centos:7

# Update repo files since change from CentOS Base to CentOS Vault on 7/1/24
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo && \
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo

RUN yum -y update && \
yum install -y httpd php && \
yum clean all

COPY container_files/httpd.conf /etc/httpd/conf/httpd.conf
COPY container_files/app.conf /etc/httpd/conf.d/app.conf
COPY container_files/html/ /var/www/html/

CMD ["httpd", "-D", "FOREGROUND"]
FROM php:8
COPY container_files/html/ /usr/src/test-app
WORKDIR /usr/src/test-app
CMD [ "php", "-S", "0.0.0.0:80" ]
16 changes: 15 additions & 1 deletion tests/containers/app/container_files/html/index.php
@@ -1 +1,15 @@
<?php phpinfo(); ?>
<?php

header('Content-type: application/json');

$headers = apache_request_headers();

$data = array(
"headers" => $headers,
);

$json = json_encode($data);

echo $json;

?>