From fd6a64842e8bd8a3e680dec04e6bd683324ba0fd Mon Sep 17 00:00:00 2001 From: aptalca Date: Sun, 3 Mar 2019 02:00:54 +0000 Subject: [PATCH] add php intl and posix modules --- Dockerfile | 2 ++ Dockerfile.aarch64 | 2 ++ Dockerfile.armhf | 2 ++ Jenkinsfile | 33 ++++++++++++++++++++++++++++++++- README.md | 33 ++++++++++++++++++++++----------- readme-vars.yml | 1 + 6 files changed, 61 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5715425..35d21ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,6 +40,7 @@ RUN \ php7-exif \ php7-gd \ php7-iconv \ + php7-intl \ php7-mcrypt \ php7-memcached \ php7-mysqli \ @@ -50,6 +51,7 @@ RUN \ php7-pdo_sqlite \ php7-pgsql \ php7-phar \ + php7-posix \ php7-soap \ php7-sockets \ php7-sqlite3 \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 79c6a0a..7e0d727 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -43,6 +43,7 @@ RUN \ php7-exif \ php7-gd \ php7-iconv \ + php7-intl \ php7-mcrypt \ php7-memcached \ php7-mysqli \ @@ -53,6 +54,7 @@ RUN \ php7-pdo_sqlite \ php7-pgsql \ php7-phar \ + php7-posix \ php7-soap \ php7-sockets \ php7-sqlite3 \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 7528b8d..563ee5e 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -43,6 +43,7 @@ RUN \ php7-exif \ php7-gd \ php7-iconv \ + php7-intl \ php7-mcrypt \ php7-memcached \ php7-mysqli \ @@ -53,6 +54,7 @@ RUN \ php7-pdo_sqlite \ php7-pgsql \ php7-phar \ + php7-posix \ php7-soap \ php7-sockets \ php7-sqlite3 \ diff --git a/Jenkinsfile b/Jenkinsfile index a323772..a307c89 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,7 @@ pipeline { script: '''curl -s https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases/latest | jq -r '. | .tag_name' ''', returnStdout: true).trim() env.LS_RELEASE_NOTES = sh( - script: '''git log -1 --pretty=%B | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''', + script: '''cat readme-vars.yml | awk -F \\" '/date: "[0-9][0-9].[0-9][0-9].[0-9][0-9]:/ {print $4;exit;}' | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''', returnStdout: true).trim() env.GITHUB_DATE = sh( script: '''date '+%Y-%m-%dT%H:%M:%S%:z' ''', @@ -280,6 +280,9 @@ pipeline { --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." sh "docker tag ${IMAGE}:arm32v6-${META_TAG} lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER}" sh "docker push lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER}" + sh '''docker rmi \ + ${IMAGE}:arm32v6-${META_TAG} \ + lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} ''' } } } @@ -306,6 +309,9 @@ pipeline { --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." sh "docker tag ${IMAGE}:arm64v8-${META_TAG} lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}" sh "docker push lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}" + sh '''docker rmi \ + ${IMAGE}:arm64v8-${META_TAG} \ + lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ''' } } } @@ -467,6 +473,10 @@ pipeline { sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:latest" sh "docker push ${IMAGE}:latest" sh "docker push ${IMAGE}:${META_TAG}" + sh '''docker rmi \ + ${IMAGE}:${META_TAG} \ + ${IMAGE}:latest ''' + } } } @@ -514,6 +524,15 @@ pipeline { sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8" sh "docker manifest push --purge ${IMAGE}:latest" sh "docker manifest push --purge ${IMAGE}:${META_TAG}" + sh '''docker rmi \ + ${IMAGE}:amd64-${META_TAG} \ + ${IMAGE}:amd64-latest \ + ${IMAGE}:arm32v6-${META_TAG} \ + ${IMAGE}:arm32v6-latest \ + ${IMAGE}:arm64v8-${META_TAG} \ + ${IMAGE}:arm64v8-latest \ + lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} \ + lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ''' } } } @@ -574,6 +593,18 @@ pipeline { } } } + // If this is a Pull request send the CI link as a comment on it + stage('Pull Request Comment') { + when { + not {environment name: 'CHANGE_ID', value: ''} + environment name: 'CI', value: 'true' + environment name: 'EXIT_STATUS', value: '' + } + steps { + sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/issues/${PULL_REQUEST}/comments \ + -d '{"body": "I am a bot, here are the test results for this PR '${CI_URL}'"}' ''' + } + } } /* ###################### Send status to Discord diff --git a/README.md b/README.md index 8744b93..57fc555 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,8 @@ Here are some example snippets to help you get started creating a container. ``` docker create \ --name=nginx \ - -e PUID=1001 \ - -e PGID=1001 \ + -e PUID=1000 \ + -e PGID=1000 \ -e TZ=Europe/London \ -p 80:80 \ -p 443:443 \ @@ -74,15 +74,14 @@ services: image: linuxserver/nginx container_name: nginx environment: - - PUID=1001 - - PGID=1001 + - PUID=1000 + - PGID=1000 - TZ=Europe/London volumes: - :/config ports: - 80:80 - 443:443 - mem_limit: 4096m restart: unless-stopped ``` @@ -94,8 +93,8 @@ Container images are configured using parameters passed at runtime (such as thos | :----: | --- | | `-p 80` | http | | `-p 443` | https | -| `-e PUID=1001` | for UserID - see below for explanation | -| `-e PGID=1001` | for GroupID - see below for explanation | +| `-e PUID=1000` | for UserID - see below for explanation | +| `-e PGID=1000` | for GroupID - see below for explanation | | `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London | | `-v /config` | Contains your www content and all relevant configuration files. | @@ -105,11 +104,11 @@ When using volumes (`-v` flags) permissions issues can arise between the host OS Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic. -In this instance `PUID=1001` and `PGID=1001`, to find yours use `id user` as below: +In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below: ``` $ id username - uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup) + uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup) ``` @@ -145,13 +144,25 @@ Below are the instructions for updating containers: * Start the new container: `docker start nginx` * You can also remove the old dangling images: `docker image prune` +### Via Taisun auto-updater (especially useful if you don't remember the original parameters) +* Pull the latest image at its tag and replace it with the same env variables in one shot: + ``` + docker run --rm \ + -v /var/run/docker.sock:/var/run/docker.sock taisun/updater \ + --oneshot nginx + ``` +* You can also remove the old dangling images: `docker image prune` + ### Via Docker Compose -* Update the image: `docker-compose pull linuxserver/nginx` -* Let compose update containers as necessary: `docker-compose up -d` +* Update all images: `docker-compose pull` + * or update a single image: `docker-compose pull nginx` +* Let compose update all containers as necessary: `docker-compose up -d` + * or update a single container: `docker-compose up -d nginx` * You can also remove the old dangling images: `docker image prune` ## Versions +* **02.03.19:** - Add php intl and posix modules. * **28.02.19:** - Add php7-opcache, remove memcached service due to issues on aarch64 (let us know if you need to enable it). * **22.02.19:** - Rebasing to alpine 3.9. * **18.11.18:** - Attempt to upgrade packages during build. diff --git a/readme-vars.yml b/readme-vars.yml index e680644..f540026 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -40,6 +40,7 @@ app_setup_block: | # changelog changelogs: + - { date: "02.03.19:", desc: "Add php intl and posix modules." } - { date: "28.02.19:", desc: "Add php7-opcache, remove memcached service due to issues on aarch64 (let us know if you need to enable it)." } - { date: "22.02.19:", desc: "Rebasing to alpine 3.9." } - { date: "18.11.18:", desc: "Attempt to upgrade packages during build." }