diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..c11ebb4b81ebef3815bc194d5a2f17c5fe1f81ab --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Vagrant +.vagrant/ +Vagrantfile \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dec1da522875848a1b0de96d20b1d59dd8a7453f..f14d4653ec9309e85fa16ca316052116c257beb0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - verify - build - test + - publish - security Check Makefile: @@ -25,15 +26,24 @@ Make All Images: - linux, dockerd script: - make - + test: stage: test tags: - dockerd script: - - docker run --rm unl-its/static-code-analysis sonar-scanner -v + - docker run --rm its-registry.unl.edu/unl-its/docker-ci/static-code-analysis sonar-scanner -v + +Push to Container Registry: + after_script: + - rm -f /var/lib/gitlab-runner/.docker/config.json + stage: publish + tags: + - linux, dockerd + script: + - make publish -Scan with Tenable: +.Scan with Tenable: stage: security tags: - linux, dockerd diff --git a/Makefile b/Makefile index e3ca46a6815af4deac24c5b4e2d154de165e5c0b..eea00f842ff2a4a663b0c1d87e550382513edc37 100644 --- a/Makefile +++ b/Makefile @@ -2,14 +2,13 @@ # Build File for Docker Images # ###################################### -# All Dockerfiles +# Repo #################### -DOCKERFILES := $(shell find ./ -name "Dockerfile") +REPO_ORG = its-registry.unl.edu/unl-its/docker-ci -# List of images to clean +# All Dockerfiles #################### -#IMAGES_TO_CLEAN := $(shell echo $(shell echo $(shell grep -h LABEL $(DOCKERFILES)) | sed -e 's/LABEL name=//g') | tr [:space:] ' \n' | sort -u) -IMAGES_TO_CLEAN := $(addprefix unl-its/, $(shell find ./ -maxdepth 1 -type d -not -name ".*" -printf '%f\n')) +DOCKERFILES := $(shell find ./ -name "Dockerfile") # Get the latest commit #################### @@ -19,67 +18,98 @@ GIT_COMMIT = $(strip $(shell git rev-parse --short HEAD)) #################### BUILD_ARGS := --build-arg VCS_REF=$(GIT_COMMIT) -.PHONY: all clean test $(DOCKERFILES) clean_images $(IMAGES_TO_CLEAN) static-code-analysis delete_dangling_images security +.PHONY: all clean test $(DOCKERFILES) static-code-analysis mobile delete_dangling_images security publish -all: \ - php-lint_5.6 php-lint_7.0 php-lint_7.1 php-lint_7.2 php-lint_latest \ - magento2-unit-test magento2-xml-lint \ - static-code-analysis +all: php-lint php-unit-test magento2 mobile static-code-analysis -# PHP Images +# Image Groups +#################### +php-lint: php-lint_5.6 php-lint_7.0 php-lint_7.1 php-lint_7.2 php-lint_latest +php-unit-test: php-unit-test_5.6 php-unit-test_7.0 php-unit-test_7.1 php-unit-test_7.2 php-unit-test_latest +magento2: magento2-unit-test magento2-xml-lint +mobile: android-build-server +static-code-analysis: static-code-analysis_latest static-code-analysys_php static-code-analysys_python static-code-analysys_android + +# PHP Lint Images #################### php-lint_5.6: php-lint/5.6/Dockerfile - docker build -t unl-its/php-lint:5.6 -f php-lint/5.6/Dockerfile php-lint + docker build $(BUILD_ARGS) -t ${REPO_ORG}/php-lint:5.6 -f php-lint/5.6/Dockerfile php-lint php-lint_7.0: php-lint/7.0/Dockerfile - docker build -t unl-its/php-lint:7.0 -f php-lint/7.0/Dockerfile php-lint + docker build $(BUILD_ARGS) -t ${REPO_ORG}/php-lint:7.0 -f php-lint/7.0/Dockerfile php-lint php-lint_7.1: php-lint/7.1/Dockerfile - docker build -t unl-its/php-lint:7.1 -f php-lint/7.1/Dockerfile php-lint + docker build $(BUILD_ARGS) -t ${REPO_ORG}/php-lint:7.1 -f php-lint/7.1/Dockerfile php-lint php-lint_7.2: php-lint/7.2/Dockerfile - docker build -t unl-its/php-lint:7.2 -f php-lint/7.2/Dockerfile php-lint + docker build $(BUILD_ARGS) -t ${REPO_ORG}/php-lint:7.2 -f php-lint/7.2/Dockerfile php-lint php-lint_latest: php-lint_7.2 - docker tag unl-its/php-lint:7.2 unl-its/php-lint:latest + docker tag ${REPO_ORG}/php-lint:7.2 ${REPO_ORG}/php-lint:latest + +# PHP Unit Test Images +#################### +php-unit-test_5.6: php-unit-test/5.6/Dockerfile + docker build $(BUILD_ARGS) -t ${REPO_ORG}/php-unit-test:5.6 -f php-unit-test/5.6/Dockerfile php-unit-test +php-unit-test_7.0: php-unit-test/7.0/Dockerfile + docker build $(BUILD_ARGS) -t ${REPO_ORG}/php-unit-test:7.0 -f php-unit-test/7.0/Dockerfile php-unit-test + +php-unit-test_7.1: php-unit-test/7.1/Dockerfile + docker build $(BUILD_ARGS) -t ${REPO_ORG}/php-unit-test:7.1 -f php-unit-test/7.1/Dockerfile php-unit-test + +php-unit-test_7.2: php-unit-test/7.2/Dockerfile + docker build $(BUILD_ARGS) -t ${REPO_ORG}/php-unit-test:7.2 -f php-unit-test/7.2/Dockerfile php-unit-test + +php-unit-test_latest: php-unit-test_7.2 + docker tag ${REPO_ORG}/php-unit-test:7.2 ${REPO_ORG}/php-unit-test:latest # Application Images #################### magento2-unit-test: magento2-unit-test/latest/Dockerfile - docker build -t unl-its/magento2-unit-test:latest magento2-unit-test/latest + docker build $(BUILD_ARGS) -t ${REPO_ORG}/magento2-unit-test:latest magento2-unit-test/latest magento2-xml-lint: magento2-unit-test magento2-xml-lint/latest/Dockerfile - docker build -t unl-its/magento2-xml-lint:latest magento2-xml-lint/latest + docker build $(BUILD_ARGS) -t ${REPO_ORG}/magento2-xml-lint:latest magento2-xml-lint/latest + +# Mobile Applications +#################### +android-build-server: android-build-server/Dockerfile + docker build $(BUILD_ARGS) -t ${REPO_ORG}/android-build-server:latest android-build-server # Sonarqube static-code-analysis # ##################### -static-code-analysis: - docker build $(BUILD_ARGS) -t unl-its/static-code-analysis:latest static-code-analysis/ - docker build $(BUILD_ARGS) -t unl-its/static-code-analysis:php static-code-analysis/ - docker build $(BUILD_ARGS) -t unl-its/static-code-analysis:python static-code-analysis/ +static-code-analysis_latest: static-code-analysis/Dockerfile + docker build $(BUILD_ARGS) -t ${REPO_ORG}/static-code-analysis:latest static-code-analysis/ -# Cleanup -#################### -clean: clean_images +static-code-analysys_php: static-code-analysis/Dockerfile + docker build $(BUILD_ARGS) -t ${REPO_ORG}/static-code-analysis:php static-code-analysis/ + +static-code-analysys_python: static-code-analysis/Dockerfile + docker build $(BUILD_ARGS) -t ${REPO_ORG}/static-code-analysis:python static-code-analysis/ + +static-code-analysys_android: android-build-server static-code-analysis/android/Dockerfile + docker build $(BUILD_ARGS) -t ${REPO_ORG}/static-code-analysis:android static-code-analysis/android/ test: $(DOCKERFILES) $(DOCKERFILES): - @echo "Linting and validating $(@D)..." + @echo "Linting and validating $(@D)..." @docker run --rm -i nimmis/label-inspector lint < $(@D)/Dockerfile @docker run --rm -i nimmis/label-inspector validate < $(@D)/Dockerfile -clean_images: $(IMAGES_TO_CLEAN) delete_dangling_images -$(IMAGES_TO_CLEAN): - @echo "Uninstalling $@" - @docker rmi $(shell docker images --format '{{.Repository}}:{{.Tag}}' --filter reference=$@) - -IMAGES_TO_SCAN = $(shell docker images --format '{{.Repository}}:{{.Tag}}' | grep unl-its ) -security: - @docker login -u ${TENABLE_IO_ACCESS_KEY} -p ${TENABLE_IO_SECRET_KEY} registry.cloud.tenable.com - @for image in $(IMAGES_TO_SCAN); do \ - docker tag $$image registry.cloud.tenable.com/`echo $$image | cut -d "/" -f 2`; \ - docker push registry.cloud.tenable.com/`echo $$image | cut -d "/" -f 2`; \ +#IMAGES_TO_SCAN = $(shell docker images --format '{{.Repository}}:{{.Tag}}' | grep unl-its ) +#security: +# @docker login -u ${TENABLE_IO_ACCESS_KEY} -p ${TENABLE_IO_SECRET_KEY} registry.cloud.tenable.com +# @for image in $(IMAGES_TO_SCAN); do \ +# docker tag $$image registry.cloud.tenable.com/`echo $$image | cut -d "/" -f 2`; \ +# docker push registry.cloud.tenable.com/`echo $$image | cut -d "/" -f 2`; \ +# done + +IMAGES_TO_PUBLISH = $(shell docker images --format '{{.Repository}}:{{.Tag}}' --filter 'dangling=false' | grep $(REPO_ORG) | grep -v ':<none>$$' ) +publish: + @docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY} + @for image in $(IMAGES_TO_PUBLISH); do \ + docker push $$image; \ done delete_dangling_images: @@ -88,10 +118,10 @@ delete_dangling_images: help: @echo -e "make [all] \n\t # Creates all the images" @echo -e "make <TARGET> \n\t # Creates an specific image" - @echo -e "make clean \n\t # Cleanup" - @echo -e "make security \n\t # Send the images to Tenable. Use env variables TENABLE_IO_ACCESS_KEY and TENABLE_IO_SECRET_KEY" + @echo -e "make publish \n\t # Push the images to the UNL registry" +# @echo -e "make security \n\t # Send the images to Tenable. Use env variables TENABLE_IO_ACCESS_KEY and TENABLE_IO_SECRET_KEY" debug: @echo -e "DOCKERFILES: \t $(DOCKERFILES)" - @echo -e "IMAGES_TO_CLEAN:\t $(IMAGES_TO_CLEAN)" - @echo -e "IMAGES_TO_SCAN:\t $(IMAGES_TO_SCAN)" +# @echo -e "IMAGES_TO_SCAN:\t $(IMAGES_TO_SCAN)" + @echo -e "IMAGES_TO_PUBLISH:\t $(IMAGES_TO_PUBLISH)" diff --git a/README.md b/README.md index 995a52e832bc53cdca5c6e566c1ef646defbcea2..7c1f31e244d211b5e709ea4cf67c8a38ddc36e3d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ -# docker-ci +[](https://git.unl.edu/unl-its/docker-ci/commits/develop) + +# Docker-ci Containers used on CI ## Building Images -To build these images, clone this repository onto a machine with docker and make installed. Run `make` and all of the images will be built and installed as local docker images. +To build these images, clone this repository onto a machine with docker and make installed. Run `make` and all of the images will be built and installed as local docker images. \ No newline at end of file diff --git a/Vagrantfile.example b/Vagrantfile.example new file mode 100644 index 0000000000000000000000000000000000000000..83221cd9fa9b6484f5d3f3ead67029c6fca008d9 --- /dev/null +++ b/Vagrantfile.example @@ -0,0 +1,36 @@ +vm_name = "docker-ci" + +Vagrant.configure(2) do |config| + +# --- UNL Linux VM configuration ------------------------- + config.vm.box = "centos/7" + config.vm.hostname = vm_name + config.vm.box_check_update = true + config.vbguest.auto_update = false + + config.vm.network "private_network", ip: "192.168.100.101" + config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['vers=3', :udp, :nolock, :noatime, :rw] + + # virtualbox VM settings + config.vm.provider "virtualbox" do |vb| + vb.linked_clone = true + vb.name = vm_name + vb.memory = "512" + vb.cpus = "1" + end +# -------------------------------------------------------------------- + + +# --- Inline provisioning ---------------------------------- + config.vm.provision "shell", inline: <<-SHELL + yum update -y + sudo yum install -y make docker git + + systemctl enable docker + systemctl start docker + + chmod o+rw /var/run/docker.sock + SHELL +# -------------------------------------------------------------------- + +end diff --git a/android-build-server/Dockerfile b/android-build-server/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..148f1056a23d2efb85b549b934feec838d863fa6 --- /dev/null +++ b/android-build-server/Dockerfile @@ -0,0 +1,32 @@ +FROM adoptopenjdk/openjdk8:alpine + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="Build Server for Android Projects" \ + org.label-schema.description="Docker image for building Android projects" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vendor="University of Nebraska - Lincoln" \ + org.label-schema.version="0.1.0" \ + org.label-schema.schema-version="1.0" \ + maintainer="Alan Nelson <alan.nelson@nebraska.edu>" + +ENV ANDROID_SDK_VERSION 4333796 +ENV ANDROID_HOME /opt/android-sdk-linux + +ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools + +WORKDIR /opt +RUN apk add --no-cache curl bash unzip libstdc++ su-exec +RUN mkdir -p /opt/android-sdk-linux \ + && curl -q -o android-sdk-tools.zip -L https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip \ + && unzip -q android-sdk-tools.zip -d ${ANDROID_HOME} \ + && rm -f android-sdk-tools.zip \ + && yes | sdkmanager --licenses + +COPY entrypoint.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] + +CMD "/bin/bash" \ No newline at end of file diff --git a/android-build-server/entrypoint.sh b/android-build-server/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..ae5005ecc0cce43e92b0deef7f09b317e36d55e1 --- /dev/null +++ b/android-build-server/entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Add local user +# Either use the LOCAL_USER_ID if passed in at runtime or +# fallback + +USER_ID=${LOCAL_USER_ID:-9001} + +su-exec user "$@" diff --git a/examples/.gitkeep b/examples/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/examples/Android.md b/examples/Android.md new file mode 100644 index 0000000000000000000000000000000000000000..1fc8b7b4668c1b1268758d343047e4210c453757 --- /dev/null +++ b/examples/Android.md @@ -0,0 +1,32 @@ +# Android example of .gitlab-ci.yml + +## Standard Android app with SonarQube analysis + +- One 'Analysis' stage with one job. +- The job SonarQube is executed only in the branch `develop`. + +``` yml +stages: + - Analysis + +variables: + GRADLE_USER_HOME: ${CI_PROJECT_DIR}/gradle_home + +before_script: + - ./gradlew dependencies + - for d in /opt/android-sdk-linux/build-tools/*; do PATH="$PATH:$d"; done + +SonarQube: + stage: Analysis + image: its-registry.unl.edu/unl-its/docker-ci/static-code-analysis:android + tags: + - docker + only: + - develop + cache: + paths: + - gradle_home + script: + - ./gradlew sonarqube -Dsonar.host.url=$SONAR_URL -Dsonar.projectKey=$CI_PROJECT_PATH_SLUG -Dsonar.login=$SONAR_TOKEN + +``` diff --git a/examples/PHP.md b/examples/PHP.md new file mode 100644 index 0000000000000000000000000000000000000000..d1ce96b8bace3b4fc5cd34e585e5e00e551f4d5f --- /dev/null +++ b/examples/PHP.md @@ -0,0 +1,39 @@ +# PHP examples of .gitlab-ci.yml + +## Standard PHP app with lint and SonarQube analysis + +- One 'test' stage with two jobs. +- The jobs needs a runner with docker-host capabilities. +- The job SonarQube is executed only in the branch `develop`. + +``` yml +# To use this script, you must have the following variables defined +# You can define them at the project or the group level +# +# SONAR_URL: Full URL to the SonarQube server +# SONAR_TOKEN: API token for SonarQube + +variables: + GITLAB_CI: 1 + +stages: + - test + +PHP Lint: + stage: test + image: its-registry.unl.edu/unl-its/docker-ci/php-lint:7.0 + tags: + - docker + script: + - php-lint -d ./ + +SonarQube: + stage: test + image: its-registry.unl.edu/unl-its/docker-ci/static-code-analysis:php + tags: + - docker + only: + - develop + script: + - sonar-scanner -Dsonar.host.url=$SONAR_URL -Dsonar.projectKey=$CI_PROJECT_PATH_SLUG -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN +``` diff --git a/magento2-xml-lint/latest/Dockerfile b/magento2-xml-lint/latest/Dockerfile index b7d5072b9930e4ee66e6fbfed5c15825dd53bfea..399e2c7fd88d1151ee7ab15c2718069a44a2bdc0 100644 --- a/magento2-xml-lint/latest/Dockerfile +++ b/magento2-xml-lint/latest/Dockerfile @@ -1,4 +1,4 @@ -FROM unl-its/magento2-unit-test:latest +FROM its-registry.unl.edu/unl-its/docker-ci/magento2-unit-test:latest ARG BUILD_DATE ARG VCS_REF @@ -9,7 +9,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.vcs-ref=$VCS_REF \ org.label-schema.vendor="University of Nebraska - Lincoln" \ org.label-schema.version=$VERSION \ - org.label-schema.schema-version="1.0" \ + org.label-schema.schema-version="1.1" \ maintainer="Alan Nelson <alan.nelson@nebraska.edu>" # Scripts diff --git a/magento2-xml-lint/latest/xml-lint b/magento2-xml-lint/latest/xml-lint index 5e5b32a6de05d33aa510e33fd518891faed2df24..e322c698d8476278bcf7d2edf4c368f74521b6ae 100644 --- a/magento2-xml-lint/latest/xml-lint +++ b/magento2-xml-lint/latest/xml-lint @@ -17,7 +17,11 @@ def get_mappings(misc_file, base_dir): return mapping def get_xml_files(search_dir): - return check_output(['find', search_dir, '-name', '*.xml']).splitlines() + try: + return check_output(['find', search_dir, '-name', '*.xml']).splitlines() + except CalledProcessError: + print("WARNING: No XML files found") + return [] def lint_only(file): try: @@ -42,20 +46,20 @@ def search_file_for_xsd(file): return None def validate_file(file, mapping): - print "validating file {}".format(file) + print("validating file {}".format(file)) xsd = search_file_for_xsd(file) if xsd is not None: if xsd in mapping: lint_with_xsd(file, mapping[xsd]) else: - print 'WARNING: Unable to map XSD to path: {}'.format(xsd) + print('WARNING: Unable to map XSD to path: {}'.format(xsd)) else: - print 'WARNING: Unable to find XSD for file: {}'.format(file) + print('WARNING: Unable to find XSD for file: {}'.format(file)) lint_only(file) def main(): if len(sys.argv) < 4: - print "Usage: xml-lint <misc.xml> <app_base_dir> <search_dir>" + print("Usage: xml-lint <misc.xml> <app_base_dir> <search_dir>") exit(1) misc_file = sys.argv[1] @@ -63,19 +67,19 @@ def main(): search_dir = os.path.abspath(sys.argv[3]) if not os.path.isfile(misc_file): - print "{} is not a file".format(misc_file) + print("{} is not a file".format(misc_file)) exit(1) mapping = get_mappings(misc_file, base_dir) - print "loaded {} XSD mapping(s)".format(len(mapping)) + print("loaded {} XSD mapping(s)".format(len(mapping))) xml_files = get_xml_files(search_dir) - print "found {} XML file(s)".format(len(xml_files)) + print("found {} XML file(s)".format(len(xml_files))) - print "" + print("") for file in xml_files: validate_file(file, mapping) - print "" + print("") if __name__ == '__main__': main() diff --git a/php-unit-test/5.6/Dockerfile b/php-unit-test/5.6/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6b1c64e70ffe971ff8e20d2ec9ae4b71592b3e5c --- /dev/null +++ b/php-unit-test/5.6/Dockerfile @@ -0,0 +1,22 @@ +FROM php:5.6-alpine + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="PHP 5.6 Unit Tester" \ + org.label-schema.description="" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vendor="University of Nebraska - Lincoln" \ + org.label-schema.version=$VERSION \ + org.label-schema.schema-version="1.0" \ + maintainer="Alan Nelson <alan.nelson@nebraska.edu>" + +RUN apk add --no-cache bash nodejs nodejs-npm $PHPIZE_DEPS \ + && pecl install xdebug-2.5.0 \ + && docker-php-ext-enable xdebug \ + && apk del --no-cache $PHPIZE_DEPS +RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \ + && chmod 755 /usr/local/bin/composer + +CMD ["bash"] diff --git a/php-unit-test/7.0/Dockerfile b/php-unit-test/7.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8ef133bb2414c7427f28762b70c197f9f505acbe --- /dev/null +++ b/php-unit-test/7.0/Dockerfile @@ -0,0 +1,22 @@ +FROM php:7.0-alpine + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="PHP 5.6 Unit Tester" \ + org.label-schema.description="" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vendor="University of Nebraska - Lincoln" \ + org.label-schema.version=$VERSION \ + org.label-schema.schema-version="1.0" \ + maintainer="Alan Nelson <alan.nelson@nebraska.edu>" + +RUN apk add --no-cache bash nodejs nodejs-npm $PHPIZE_DEPS \ + && pecl install xdebug \ + && docker-php-ext-enable xdebug \ + && apk del --no-cache $PHPIZE_DEPS +RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \ + && chmod 755 /usr/local/bin/composer + +CMD ["bash"] diff --git a/php-unit-test/7.1/Dockerfile b/php-unit-test/7.1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..63ce09cb3f9dc803d13341d5a6edeab378b2c7cd --- /dev/null +++ b/php-unit-test/7.1/Dockerfile @@ -0,0 +1,22 @@ +FROM php:7.1-alpine + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="PHP 5.6 Unit Tester" \ + org.label-schema.description="" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vendor="University of Nebraska - Lincoln" \ + org.label-schema.version=$VERSION \ + org.label-schema.schema-version="1.0" \ + maintainer="Alan Nelson <alan.nelson@nebraska.edu>" + +RUN apk add --no-cache bash nodejs nodejs-npm $PHPIZE_DEPS \ + && pecl install xdebug \ + && docker-php-ext-enable xdebug \ + && apk del --no-cache $PHPIZE_DEPS +RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \ + && chmod 755 /usr/local/bin/composer + +CMD ["bash"] diff --git a/php-unit-test/7.2/Dockerfile b/php-unit-test/7.2/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..97bdcd162a98ea51fc46b6bc3885aff7b827d710 --- /dev/null +++ b/php-unit-test/7.2/Dockerfile @@ -0,0 +1,22 @@ +FROM php:7.2-alpine + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="PHP 5.6 Unit Tester" \ + org.label-schema.description="" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vendor="University of Nebraska - Lincoln" \ + org.label-schema.version=$VERSION \ + org.label-schema.schema-version="1.0" \ + maintainer="Alan Nelson <alan.nelson@nebraska.edu>" + +RUN apk add --no-cache bash nodejs nodejs-npm $PHPIZE_DEPS \ + && pecl install xdebug \ + && docker-php-ext-enable xdebug \ + && apk del --no-cache $PHPIZE_DEPS +RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \ + && chmod 755 /usr/local/bin/composer + +CMD ["bash"] diff --git a/static-code-analysis/Dockerfile b/static-code-analysis/Dockerfile index afa9f95a5f370769c596cf1ad21b80dfabfbb4ac..a6524d42c39d6bbb06d00fb2c08cc0ea0baf8cce 100644 --- a/static-code-analysis/Dockerfile +++ b/static-code-analysis/Dockerfile @@ -12,7 +12,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.schema-version="1.0" \ maintainer="J.R. Barreras <barreras@unl.edu>" -ENV SONAR_SCANNER_VERSION 3.2.0.1227 +ENV SONAR_SCANNER_VERSION 3.3.0.1492 WORKDIR /opt diff --git a/static-code-analysis/android/Dockerfile b/static-code-analysis/android/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7ec3ab9376c38e78432e870652708fffa1ede442 --- /dev/null +++ b/static-code-analysis/android/Dockerfile @@ -0,0 +1,24 @@ +FROM its-registry.unl.edu/unl-its/docker-ci/android-build-server + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="Android Static Code Analyzer" \ + org.label-schema.description="Docker image for static code analysis of Android projects" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vendor="University of Nebraska - Lincoln" \ + org.label-schema.version="0.1.0" \ + org.label-schema.schema-version="1.0" \ + maintainer="Alan Nelson <alan.nelson@nebraska.edu>" + +ENV SONAR_SCANNER_VERSION 3.2.0.1227 +ENV SONAR_HOME /opt/sonar-scanner + +ENV PATH ${PATH}:${SONAR_HOME} + +WORKDIR /opt +RUN mkdir -p /opt/src \ + && curl -q -o sonarscanner.zip -L https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip \ + && unzip -q sonarscanner.zip -d ${SONAR_HOME} \ + && rm sonarscanner.zip