From 6816e7c474cf439c5e600b90eec6b6a93c74fce7 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Mon, 21 Jul 2025 22:38:53 -0500 Subject: [PATCH 01/36] PR template --- .github/PULL_REQUEST_TEMPLATE.md | 63 ++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0b4431d4..c1f5d9e2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,43 +1,50 @@ - +ver_medium.png)][linuxserverurl] -[linuxserverurl]: https://linuxserver.io -[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] +ut. We do not need a PR --> +ange for corner case functionality or plugins please look at making a Docker Mod or local script https://blog.linuxserver.io/2019/09/14/customizing-our-containers/ --> +message --> +--> +repository, please add your changes there if appropriate --> +TRIBUTING.md) guideline and understand that I have made the correct modifications - +> - - - - - +## Description +Required: Please provide a brief description of what this pull request is trying to accomplish. - - - - - +> ------------------------------- +## Context, Consequences, & Considerations - - [ ] I have read the [contributing](https://github.com/linuxserver/docker-baseimage-ubuntu/blob/jammy/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications +Required: Please step through the following list, pausing at each item to consider your change in relation to the item's context. +Check the box to mark that it applies, and enter your relevant notes under the item. ------------------------------- +- [ ] Security: This has security implications. This includes (but not limited to) adding users, modifying user/app permissions, network rules/policies, changing a system interconnection, or changing an authorization strategy. + - [ ] This PR does not require security review. These changes are part of a project plan that has already undergone security review. The link is provided below. + - [ ] This PR requires security review. Add the `security` label to this PR then request a review from the [Security Code Reviewers Team](https://github.com/orgs/civisanalytics/teams/security-code-reviewers). - +> -## Description: - +- [ ] Execution: This change requires commands to be run outside of the normal merge. -## Benefits of this PR and context: - +> -## How Has This Been Tested? - - - +- [ ] Impact: This change may cause service interruptions. +> -## Source / References: - +- [ ] Testing: How did you test this change (unit tests, acceptance tests, etc.)? Did you do any manual testing? + +> + +- [ ] Testing: How will you confirm this change once it's merged? + +> + +- [ ] Documentation: Documentation to reflect this change has been added to Confluence or Zendesk. + +> + +- [ ] **All items of the checklist have been considered and this PR description is complete.** From 7c0bda105871713745daff860834a8017971f1cb Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Mon, 21 Jul 2025 22:46:59 -0500 Subject: [PATCH 02/36] remove jenkins things --- Jenkinsfile | 1142 ---------------------------------------------- jenkins-vars.yml | 26 -- 2 files changed, 1168 deletions(-) delete mode 100755 Jenkinsfile delete mode 100644 jenkins-vars.yml diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100755 index 564f20c0..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,1142 +0,0 @@ -pipeline { - agent { - label 'X86-64-MULTI' - } - options { - buildDiscarder(logRotator(numToKeepStr: '10', daysToKeepStr: '60')) - parallelsAlwaysFailFast() - } - // Input to determine if this is a package check - parameters { - string(defaultValue: 'false', description: 'package check run', name: 'PACKAGE_CHECK') - } - // Configuration for the variables used for this specific repo - environment { - BUILDS_DISCORD=credentials('build_webhook_url') - GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab') - GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0') - GITLAB_NAMESPACE=credentials('gitlab-namespace-id') - DOCKERHUB_TOKEN=credentials('docker-hub-ci-pat') - QUAYIO_API_TOKEN=credentials('quayio-repo-api-token') - GIT_SIGNING_KEY=credentials('484fbca6-9a4f-455e-b9e3-97ac98785f5f') - BUILD_VERSION_ARG = 'OS' - LS_USER = 'linuxserver' - LS_REPO = 'docker-baseimage-ubuntu' - CONTAINER_NAME = 'baseimage-ubuntu' - DOCKERHUB_IMAGE = 'lsiobase/ubuntu' - DEV_DOCKERHUB_IMAGE = 'lsiodev/ubuntu' - PR_DOCKERHUB_IMAGE = 'lspipepr/ubuntu' - DIST_IMAGE = 'ubuntu' - MULTIARCH='true' - CI='true' - CI_WEB='false' - CI_PORT='80' - CI_SSL='true' - CI_DELAY='30' - CI_DOCKERENV='LSIO_FIRST_PARTY=true' - CI_AUTH='' - CI_WEBPATH='' - } - stages { - stage("Set git config"){ - steps{ - sh '''#!/bin/bash - cat ${GIT_SIGNING_KEY} > /config/.ssh/id_sign - chmod 600 /config/.ssh/id_sign - ssh-keygen -y -f /config/.ssh/id_sign > /config/.ssh/id_sign.pub - echo "Using $(ssh-keygen -lf /config/.ssh/id_sign) to sign commits" - git config --global gpg.format ssh - git config --global user.signingkey /config/.ssh/id_sign - git config --global commit.gpgsign true - ''' - } - } - // Setup all the basic environment variables needed for the build - stage("Set ENV Variables base"){ - steps{ - echo "Running on node: ${NODE_NAME}" - sh '''#! /bin/bash - echo "Pruning builder" - docker builder prune -f --builder container || : - containers=$(docker ps -q) - if [[ -n "${containers}" ]]; then - BUILDX_CONTAINER_ID=$(docker ps -qf 'name=buildx_buildkit') - for container in ${containers}; do - if [[ "${container}" == "${BUILDX_CONTAINER_ID}" ]]; then - echo "skipping buildx container in docker stop" - else - echo "Stopping container ${container}" - docker stop ${container} - fi - done - fi - docker system prune -f --volumes || : - docker image prune -af || : - ''' - script{ - env.EXIT_STATUS = '' - env.LS_RELEASE = sh( - script: '''docker run --rm quay.io/skopeo/stable:v1 inspect docker://ghcr.io/${LS_USER}/${CONTAINER_NAME}:jammy 2>/dev/null | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''', - returnStdout: true).trim() - env.LS_RELEASE_NOTES = sh( - 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' ''', - returnStdout: true).trim() - env.COMMIT_SHA = sh( - script: '''git rev-parse HEAD''', - returnStdout: true).trim() - env.GH_DEFAULT_BRANCH = sh( - script: '''git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||' ''', - returnStdout: true).trim() - env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT - env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/' - env.PULL_REQUEST = env.CHANGE_ID - env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE .editorconfig ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.yml ./.github/ISSUE_TEMPLATE/issue.feature.yml ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/external_trigger_scheduler.yml ./.github/workflows/greetings.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/call_issue_pr_tracker.yml ./.github/workflows/call_issues_cron.yml ./.github/workflows/permissions.yml ./.github/workflows/external_trigger.yml' - if ( env.SYFT_IMAGE_TAG == null ) { - env.SYFT_IMAGE_TAG = 'latest' - } - } - echo "Using syft image tag ${SYFT_IMAGE_TAG}" - sh '''#! /bin/bash - echo "The default github branch detected as ${GH_DEFAULT_BRANCH}" ''' - script{ - env.LS_RELEASE_NUMBER = sh( - script: '''echo ${LS_RELEASE} |sed 's/^.*-ls//g' ''', - returnStdout: true).trim() - } - script{ - env.LS_TAG_NUMBER = sh( - script: '''#! /bin/bash - tagsha=$(git rev-list -n 1 jammy-${LS_RELEASE} 2>/dev/null) - if [ "${tagsha}" == "${COMMIT_SHA}" ]; then - echo ${LS_RELEASE_NUMBER} - elif [ -z "${GIT_COMMIT}" ]; then - echo ${LS_RELEASE_NUMBER} - else - echo $((${LS_RELEASE_NUMBER} + 1)) - fi''', - returnStdout: true).trim() - } - } - } - /* ####################### - Package Version Tagging - ####################### */ - // Grab the current package versions in Git to determine package tag - stage("Set Package tag"){ - steps{ - script{ - env.PACKAGE_TAG = sh( - script: '''#!/bin/bash - if [ -e package_versions.txt ] ; then - cat package_versions.txt | md5sum | cut -c1-8 - else - echo none - fi''', - returnStdout: true).trim() - } - } - } - /* ######################## - External Release Tagging - ######################## */ - // If this is an os release set release type to none to indicate no external release - stage("Set ENV os"){ - steps{ - script{ - env.EXT_RELEASE = env.PACKAGE_TAG - env.RELEASE_LINK = 'none' - } - } - } - // Sanitize the release tag and strip illegal docker or github characters - stage("Sanitize tag"){ - steps{ - script{ - env.EXT_RELEASE_CLEAN = sh( - script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:/ ]//g' ''', - returnStdout: true).trim() - - def semver = env.EXT_RELEASE_CLEAN =~ /(\d+)\.(\d+)\.(\d+)/ - if (semver.find()) { - env.SEMVER = "${semver[0][1]}.${semver[0][2]}.${semver[0][3]}" - } else { - semver = env.EXT_RELEASE_CLEAN =~ /(\d+)\.(\d+)(?:\.(\d+))?(.*)/ - if (semver.find()) { - if (semver[0][3]) { - env.SEMVER = "${semver[0][1]}.${semver[0][2]}.${semver[0][3]}" - } else if (!semver[0][3] && !semver[0][4]) { - env.SEMVER = "${semver[0][1]}.${semver[0][2]}.${(new Date()).format('YYYYMMdd')}" - } - } - } - - if (env.SEMVER != null) { - if (BRANCH_NAME != "${env.GH_DEFAULT_BRANCH}") { - env.SEMVER = "${env.SEMVER}-${BRANCH_NAME}" - } - println("SEMVER: ${env.SEMVER}") - } else { - println("No SEMVER detected") - } - - } - } - } - // If this is a jammy build use live docker endpoints - stage("Set ENV live build"){ - when { - branch "jammy" - environment name: 'CHANGE_ID', value: '' - } - steps { - script{ - env.IMAGE = env.DOCKERHUB_IMAGE - env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/' + env.CONTAINER_NAME - env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/' + env.CONTAINER_NAME - env.QUAYIMAGE = 'quay.io/linuxserver.io/' + env.CONTAINER_NAME - if (env.MULTIARCH == 'true') { - env.CI_TAGS = 'amd64-jammy-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-jammy-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER - } else { - env.CI_TAGS = 'jammy-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER - } - env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER - env.META_TAG = 'jammy-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER - env.EXT_RELEASE_TAG = 'jammy-version-' + env.EXT_RELEASE_CLEAN - env.BUILDCACHE = 'docker.io/lsiodev/buildcache,registry.gitlab.com/linuxserver.io/docker-jenkins-builder/lsiodev-buildcache,ghcr.io/linuxserver/lsiodev-buildcache,quay.io/linuxserver.io/lsiodev-buildcache' - } - } - } - // If this is a dev build use dev docker endpoints - stage("Set ENV dev build"){ - when { - not {branch "jammy"} - environment name: 'CHANGE_ID', value: '' - } - steps { - script{ - env.IMAGE = env.DEV_DOCKERHUB_IMAGE - env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lsiodev-' + env.CONTAINER_NAME - env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lsiodev-' + env.CONTAINER_NAME - env.QUAYIMAGE = 'quay.io/linuxserver.io/lsiodev-' + env.CONTAINER_NAME - if (env.MULTIARCH == 'true') { - env.CI_TAGS = 'amd64-jammy-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-jammy-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA - } else { - env.CI_TAGS = 'jammy-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA - } - env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA - env.META_TAG = 'jammy-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA - env.EXT_RELEASE_TAG = 'jammy-version-' + env.EXT_RELEASE_CLEAN - env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/' - env.BUILDCACHE = 'docker.io/lsiodev/buildcache,registry.gitlab.com/linuxserver.io/docker-jenkins-builder/lsiodev-buildcache,ghcr.io/linuxserver/lsiodev-buildcache,quay.io/linuxserver.io/lsiodev-buildcache' - } - } - } - // If this is a pull request build use dev docker endpoints - stage("Set ENV PR build"){ - when { - not {environment name: 'CHANGE_ID', value: ''} - } - steps { - script{ - env.IMAGE = env.PR_DOCKERHUB_IMAGE - env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lspipepr-' + env.CONTAINER_NAME - env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lspipepr-' + env.CONTAINER_NAME - env.QUAYIMAGE = 'quay.io/linuxserver.io/lspipepr-' + env.CONTAINER_NAME - if (env.MULTIARCH == 'true') { - env.CI_TAGS = 'amd64-jammy-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '-pr-' + env.PULL_REQUEST + '|arm64v8-jammy-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '-pr-' + env.PULL_REQUEST - } else { - env.CI_TAGS = 'jammy-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '-pr-' + env.PULL_REQUEST - } - env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '-pr-' + env.PULL_REQUEST - env.META_TAG = 'jammy-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '-pr-' + env.PULL_REQUEST - env.EXT_RELEASE_TAG = 'jammy-version-' + env.EXT_RELEASE_CLEAN - env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST - env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.PR_DOCKERHUB_IMAGE + '/tags/' - env.BUILDCACHE = 'docker.io/lsiodev/buildcache,registry.gitlab.com/linuxserver.io/docker-jenkins-builder/lsiodev-buildcache,ghcr.io/linuxserver/lsiodev-buildcache,quay.io/linuxserver.io/lsiodev-buildcache' - } - } - } - // Run ShellCheck - stage('ShellCheck') { - when { - environment name: 'CI', value: 'true' - } - steps { - withCredentials([ - string(credentialsId: 'ci-tests-s3-key-id', variable: 'S3_KEY'), - string(credentialsId: 'ci-tests-s3-secret-access-key', variable: 'S3_SECRET') - ]) { - script{ - env.SHELLCHECK_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/shellcheck-result.xml' - } - sh '''curl -sL https://raw.githubusercontent.com/linuxserver/docker-jenkins-builder/master/checkrun.sh | /bin/bash''' - sh '''#! /bin/bash - docker run --rm \ - -v ${WORKSPACE}:/mnt \ - -e AWS_ACCESS_KEY_ID=\"${S3_KEY}\" \ - -e AWS_SECRET_ACCESS_KEY=\"${S3_SECRET}\" \ - ghcr.io/linuxserver/baseimage-alpine:3.20 s6-envdir -fn -- /var/run/s6/container_environment /bin/bash -c "\ - apk add --no-cache python3 && \ - python3 -m venv /lsiopy && \ - pip install --no-cache-dir -U pip && \ - pip install --no-cache-dir s3cmd && \ - s3cmd put --no-preserve --acl-public -m text/xml /mnt/shellcheck-result.xml s3://ci-tests.linuxserver.io/${IMAGE}/${META_TAG}/shellcheck-result.xml" || :''' - } - } - } - // Use helper containers to render templated files - stage('Update-Templates') { - when { - branch "jammy" - environment name: 'CHANGE_ID', value: '' - expression { - env.CONTAINER_NAME != null - } - } - steps { - sh '''#! /bin/bash - set -e - TEMPDIR=$(mktemp -d) - docker pull ghcr.io/linuxserver/jenkins-builder:latest - # Cloned repo paths for templating: - # ${TEMPDIR}/docker-${CONTAINER_NAME}: Cloned branch jammy of ${LS_USER}/${LS_REPO} for running the jenkins builder on - # ${TEMPDIR}/repo/${LS_REPO}: Cloned branch jammy of ${LS_USER}/${LS_REPO} for commiting various templated file changes and pushing back to Github - # ${TEMPDIR}/docs/docker-documentation: Cloned docs repo for pushing docs updates to Github - # ${TEMPDIR}/unraid/docker-templates: Cloned docker-templates repo to check for logos - # ${TEMPDIR}/unraid/templates: Cloned templates repo for commiting unraid template changes and pushing back to Github - git clone --branch jammy --depth 1 https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/docker-${CONTAINER_NAME} - docker run --rm -v ${TEMPDIR}/docker-${CONTAINER_NAME}:/tmp -e LOCAL=true -e PUID=$(id -u) -e PGID=$(id -g) ghcr.io/linuxserver/jenkins-builder:latest - echo "Starting Stage 1 - Jenkinsfile update" - if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then - mkdir -p ${TEMPDIR}/repo - git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} - cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f jammy - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/ - git add Jenkinsfile - git commit -m 'Bot Updating Templated Files' - git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git jammy - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git jammy - echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} - echo "Updating Jenkinsfile and exiting build, new one will trigger based on commit" - rm -Rf ${TEMPDIR} - exit 0 - else - echo "Jenkinsfile is up to date." - fi - echo "Starting Stage 2 - Delete old templates" - OLD_TEMPLATES=".github/ISSUE_TEMPLATE.md .github/ISSUE_TEMPLATE/issue.bug.md .github/ISSUE_TEMPLATE/issue.feature.md .github/workflows/call_invalid_helper.yml .github/workflows/stale.yml .github/workflows/package_trigger.yml" - for i in ${OLD_TEMPLATES}; do - if [[ -f "${i}" ]]; then - TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}" - fi - done - if [[ -n "${TEMPLATES_TO_DELETE}" ]]; then - mkdir -p ${TEMPDIR}/repo - git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} - cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f jammy - for i in ${TEMPLATES_TO_DELETE}; do - git rm "${i}" - done - git commit -m 'Bot Updating Templated Files' - git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git jammy - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git jammy - echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} - echo "Deleting old/deprecated templates and exiting build, new one will trigger based on commit" - rm -Rf ${TEMPDIR} - exit 0 - else - echo "No templates to delete" - fi - echo "Starting Stage 3 - Update templates" - CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) - cd ${TEMPDIR}/docker-${CONTAINER_NAME} - NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) - if [[ "${CURRENTHASH}" != "${NEWHASH}" ]] || ! grep -q '.jenkins-external' "${WORKSPACE}/.gitignore" 2>/dev/null; then - mkdir -p ${TEMPDIR}/repo - git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} - cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f jammy - cd ${TEMPDIR}/docker-${CONTAINER_NAME} - mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows - mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE - cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || : - cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || : - cd ${TEMPDIR}/repo/${LS_REPO}/ - if ! grep -q '.jenkins-external' .gitignore 2>/dev/null; then - echo ".jenkins-external" >> .gitignore - git add .gitignore - fi - git add readme-vars.yml ${TEMPLATED_FILES} - git commit -m 'Bot Updating Templated Files' - git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git jammy - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git jammy - echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} - echo "Updating templates and exiting build, new one will trigger based on commit" - rm -Rf ${TEMPDIR} - exit 0 - else - echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} - echo "No templates to update" - fi - echo "Starting Stage 4 - External repo updates: Docs, Unraid Template and Readme Sync to Docker Hub" - mkdir -p ${TEMPDIR}/docs - git clone --depth=1 https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/docs/docker-documentation - if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/docs/docker-documentation/docs/images/ - cd ${TEMPDIR}/docs/docker-documentation - GH_DOCS_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||') - git add docs/images/docker-${CONTAINER_NAME}.md - echo "Updating docs repo" - git commit -m 'Bot Updating Documentation' - git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} || \ - (MAXWAIT="10" && echo "Push to docs failed, trying again in ${MAXWAIT} seconds" && \ - sleep $((RANDOM % MAXWAIT)) && \ - git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase && \ - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH}) - else - echo "Docs update not needed, skipping" - fi - if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]]; then - if [[ $(cat ${TEMPDIR}/docker-${CONTAINER_NAME}/README.md | wc -m) -gt 25000 ]]; then - echo "Readme is longer than 25,000 characters. Syncing the lite version to Docker Hub" - DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/README.lite" - else - echo "Syncing readme to Docker Hub" - DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/README.md" - fi - if curl -s https://hub.docker.com/v2/namespaces/${DOCKERHUB_IMAGE%%/*}/repositories/${DOCKERHUB_IMAGE##*/}/tags | jq -r '.message' | grep -q 404; then - echo "Docker Hub endpoint doesn't exist. Creating endpoint first." - DH_TOKEN=$(curl -d '{"username":"linuxserverci", "password":"'${DOCKERHUB_TOKEN}'"}' -H "Content-Type: application/json" -X POST https://hub.docker.com/v2/users/login | jq -r '.token') - curl -s \ - -H "Authorization: JWT ${DH_TOKEN}" \ - -H "Content-Type: application/json" \ - -X POST \ - -d '{"name":"'${DOCKERHUB_IMAGE##*/}'", "namespace":"'${DOCKERHUB_IMAGE%%/*}'"}' \ - https://hub.docker.com/v2/repositories/ || : - fi - DH_TOKEN=$(curl -d '{"username":"linuxserverci", "password":"'${DOCKERHUB_TOKEN}'"}' -H "Content-Type: application/json" -X POST https://hub.docker.com/v2/users/login | jq -r '.token') - curl -s \ - -H "Authorization: JWT ${DH_TOKEN}" \ - -H "Content-Type: application/json" \ - -X PATCH \ - -d "{\\"full_description\\":$(jq -Rsa . ${DH_README_SYNC_PATH})}" \ - https://hub.docker.com/v2/repositories/${DOCKERHUB_IMAGE} || : - else - echo "Not the default Github branch. Skipping readme sync to Docker Hub." - fi - rm -Rf ${TEMPDIR}''' - script{ - env.FILES_UPDATED = sh( - script: '''cat /tmp/${COMMIT_SHA}-${BUILD_NUMBER}''', - returnStdout: true).trim() - } - } - } - // Exit the build if the Templated files were just updated - stage('Template-exit') { - when { - branch "jammy" - environment name: 'CHANGE_ID', value: '' - environment name: 'FILES_UPDATED', value: 'true' - expression { - env.CONTAINER_NAME != null - } - } - steps { - script{ - env.EXIT_STATUS = 'ABORTED' - } - } - } - // If this is a jammy build check the S6 service file perms - stage("Check S6 Service file Permissions"){ - when { - branch "jammy" - environment name: 'CHANGE_ID', value: '' - environment name: 'EXIT_STATUS', value: '' - } - steps { - script{ - sh '''#! /bin/bash - WRONG_PERM=$(find ./ -path "./.git" -prune -o \\( -name "run" -o -name "finish" -o -name "check" \\) -not -perm -u=x,g=x,o=x -print) - if [[ -n "${WRONG_PERM}" ]]; then - echo "The following S6 service files are missing the executable bit; canceling the faulty build: ${WRONG_PERM}" - exit 1 - else - echo "S6 service file perms look good." - fi ''' - } - } - } - /* ####################### - GitLab Mirroring and Quay.io Repo Visibility - ####################### */ - // Ping into Gitlab to mirror this repo and have a registry endpoint & mark this repo on Quay.io as public - stage("GitLab Mirror and Quay.io Visibility"){ - when { - environment name: 'EXIT_STATUS', value: '' - } - steps{ - sh '''curl -H "Content-Type: application/json" -H "Private-Token: ${GITLAB_TOKEN}" -X POST https://gitlab.com/api/v4/projects \ - -d '{"namespace_id":'${GITLAB_NAMESPACE}',\ - "name":"'${LS_REPO}'", - "mirror":true,\ - "import_url":"https://github.com/linuxserver/'${LS_REPO}'.git",\ - "issues_access_level":"disabled",\ - "merge_requests_access_level":"disabled",\ - "repository_access_level":"enabled",\ - "visibility":"public"}' ''' - sh '''curl -H "Private-Token: ${GITLAB_TOKEN}" -X PUT "https://gitlab.com/api/v4/projects/Linuxserver.io%2F${LS_REPO}" \ - -d "mirror=true&import_url=https://github.com/linuxserver/${LS_REPO}.git" ''' - sh '''curl -H "Content-Type: application/json" -H "Authorization: Bearer ${QUAYIO_API_TOKEN}" -X POST "https://quay.io/api/v1/repository${QUAYIMAGE/quay.io/}/changevisibility" \ - -d '{"visibility":"public"}' ||: ''' - } - } - /* ############### - Build Container - ############### */ - // Build Docker container for push to LS Repo - stage('Build-Single') { - when { - expression { - env.MULTIARCH == 'false' || params.PACKAGE_CHECK == 'true' - } - environment name: 'EXIT_STATUS', value: '' - } - steps { - echo "Running on node: ${NODE_NAME}" - sh "docker buildx build \ - --label \"org.opencontainers.image.created=${GITHUB_DATE}\" \ - --label \"org.opencontainers.image.authors=linuxserver.io\" \ - --label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-baseimage-ubuntu/packages\" \ - --label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-baseimage-ubuntu\" \ - --label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-baseimage-ubuntu\" \ - --label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \ - --label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \ - --label \"org.opencontainers.image.vendor=linuxserver.io\" \ - --label \"org.opencontainers.image.licenses=GPL-3.0-only\" \ - --label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \ - --label \"org.opencontainers.image.title=Baseimage-ubuntu\" \ - --label \"org.opencontainers.image.description=baseimage-ubuntu image by linuxserver.io\" \ - --no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \ - --provenance=true --sbom=true --builder=container --load \ - --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." - sh '''#! /bin/bash - set -e - IFS=',' read -ra CACHE <<< "$BUILDCACHE" - for i in "${CACHE[@]}"; do - docker tag ${IMAGE}:${META_TAG} ${i}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} - done - ''' - withCredentials([ - [ - $class: 'UsernamePasswordMultiBinding', - credentialsId: 'Quay.io-Robot', - usernameVariable: 'QUAYUSER', - passwordVariable: 'QUAYPASS' - ] - ]) { - retry_backoff(5,5) { - sh '''#! /bin/bash - set -e - echo $DOCKERHUB_TOKEN | docker login -u linuxserverci --password-stdin - echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin - echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin - echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin - if [[ "${PACKAGE_CHECK}" != "true" ]]; then - IFS=',' read -ra CACHE <<< "$BUILDCACHE" - for i in "${CACHE[@]}"; do - docker push ${i}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} & - done - for p in $(jobs -p); do - wait "$p" || { echo "job $p failed" >&2; exit 1; } - done - fi - ''' - } - } - } - } - // Build MultiArch Docker containers for push to LS Repo - stage('Build-Multi') { - when { - allOf { - environment name: 'MULTIARCH', value: 'true' - expression { params.PACKAGE_CHECK == 'false' } - } - environment name: 'EXIT_STATUS', value: '' - } - parallel { - stage('Build X86') { - steps { - echo "Running on node: ${NODE_NAME}" - sh "docker buildx build \ - --label \"org.opencontainers.image.created=${GITHUB_DATE}\" \ - --label \"org.opencontainers.image.authors=linuxserver.io\" \ - --label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-baseimage-ubuntu/packages\" \ - --label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-baseimage-ubuntu\" \ - --label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-baseimage-ubuntu\" \ - --label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \ - --label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \ - --label \"org.opencontainers.image.vendor=linuxserver.io\" \ - --label \"org.opencontainers.image.licenses=GPL-3.0-only\" \ - --label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \ - --label \"org.opencontainers.image.title=Baseimage-ubuntu\" \ - --label \"org.opencontainers.image.description=baseimage-ubuntu image by linuxserver.io\" \ - --no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \ - --provenance=true --sbom=true --builder=container --load \ - --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." - sh '''#! /bin/bash - set -e - IFS=',' read -ra CACHE <<< "$BUILDCACHE" - for i in "${CACHE[@]}"; do - docker tag ${IMAGE}:amd64-${META_TAG} ${i}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} - done - ''' - withCredentials([ - [ - $class: 'UsernamePasswordMultiBinding', - credentialsId: 'Quay.io-Robot', - usernameVariable: 'QUAYUSER', - passwordVariable: 'QUAYPASS' - ] - ]) { - retry_backoff(5,5) { - sh '''#! /bin/bash - set -e - echo $DOCKERHUB_TOKEN | docker login -u linuxserverci --password-stdin - echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin - echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin - echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin - if [[ "${PACKAGE_CHECK}" != "true" ]]; then - IFS=',' read -ra CACHE <<< "$BUILDCACHE" - for i in "${CACHE[@]}"; do - docker push ${i}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} & - done - for p in $(jobs -p); do - wait "$p" || { echo "job $p failed" >&2; exit 1; } - done - fi - ''' - } - } - } - } - stage('Build ARM64') { - agent { - label 'ARM64' - } - steps { - echo "Running on node: ${NODE_NAME}" - sh "docker buildx build \ - --label \"org.opencontainers.image.created=${GITHUB_DATE}\" \ - --label \"org.opencontainers.image.authors=linuxserver.io\" \ - --label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-baseimage-ubuntu/packages\" \ - --label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-baseimage-ubuntu\" \ - --label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-baseimage-ubuntu\" \ - --label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \ - --label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \ - --label \"org.opencontainers.image.vendor=linuxserver.io\" \ - --label \"org.opencontainers.image.licenses=GPL-3.0-only\" \ - --label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \ - --label \"org.opencontainers.image.title=Baseimage-ubuntu\" \ - --label \"org.opencontainers.image.description=baseimage-ubuntu image by linuxserver.io\" \ - --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \ - --provenance=true --sbom=true --builder=container --load \ - --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." - sh '''#! /bin/bash - set -e - IFS=',' read -ra CACHE <<< "$BUILDCACHE" - for i in "${CACHE[@]}"; do - docker tag ${IMAGE}:arm64v8-${META_TAG} ${i}:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} - done - ''' - withCredentials([ - [ - $class: 'UsernamePasswordMultiBinding', - credentialsId: 'Quay.io-Robot', - usernameVariable: 'QUAYUSER', - passwordVariable: 'QUAYPASS' - ] - ]) { - retry_backoff(5,5) { - sh '''#! /bin/bash - set -e - echo $DOCKERHUB_TOKEN | docker login -u linuxserverci --password-stdin - echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin - echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin - echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin - if [[ "${PACKAGE_CHECK}" != "true" ]]; then - IFS=',' read -ra CACHE <<< "$BUILDCACHE" - for i in "${CACHE[@]}"; do - docker push ${i}:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} & - done - for p in $(jobs -p); do - wait "$p" || { echo "job $p failed" >&2; exit 1; } - done - fi - ''' - } - } - sh '''#! /bin/bash - containers=$(docker ps -aq) - if [[ -n "${containers}" ]]; then - docker stop ${containers} - fi - docker system prune -f --volumes || : - docker image prune -af || : - ''' - } - } - } - } - // Take the image we just built and dump package versions for comparison - stage('Update-packages') { - when { - branch "jammy" - environment name: 'CHANGE_ID', value: '' - environment name: 'EXIT_STATUS', value: '' - } - steps { - sh '''#! /bin/bash - set -e - TEMPDIR=$(mktemp -d) - if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" != "true" ]; then - LOCAL_CONTAINER=${IMAGE}:amd64-${META_TAG} - else - LOCAL_CONTAINER=${IMAGE}:${META_TAG} - fi - touch ${TEMPDIR}/package_versions.txt - docker run --rm \ - -v /var/run/docker.sock:/var/run/docker.sock:ro \ - -v ${TEMPDIR}:/tmp \ - ghcr.io/anchore/syft:${SYFT_IMAGE_TAG} \ - ${LOCAL_CONTAINER} -o table=/tmp/package_versions.txt - NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 ) - echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github" - if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then - git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO} - git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f jammy - cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/ - cd ${TEMPDIR}/${LS_REPO}/ - wait - git add package_versions.txt - git commit -m 'Bot Updating Package Versions' - git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git jammy - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git jammy - echo "true" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER} - echo "Package tag updated, stopping build process" - else - echo "false" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER} - echo "Package tag is same as previous continue with build process" - fi - rm -Rf ${TEMPDIR}''' - script{ - env.PACKAGE_UPDATED = sh( - script: '''cat /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}''', - returnStdout: true).trim() - } - } - } - // Exit the build if the package file was just updated - stage('PACKAGE-exit') { - when { - branch "jammy" - environment name: 'CHANGE_ID', value: '' - environment name: 'PACKAGE_UPDATED', value: 'true' - environment name: 'EXIT_STATUS', value: '' - } - steps { - script{ - env.EXIT_STATUS = 'ABORTED' - } - } - } - // Exit the build if this is just a package check and there are no changes to push - stage('PACKAGECHECK-exit') { - when { - branch "jammy" - environment name: 'CHANGE_ID', value: '' - environment name: 'PACKAGE_UPDATED', value: 'false' - environment name: 'EXIT_STATUS', value: '' - expression { - params.PACKAGE_CHECK == 'true' - } - } - steps { - script{ - env.EXIT_STATUS = 'ABORTED' - } - } - } - /* ####### - Testing - ####### */ - // Run Container tests - stage('Test') { - when { - environment name: 'CI', value: 'true' - environment name: 'EXIT_STATUS', value: '' - } - steps { - withCredentials([ - string(credentialsId: 'ci-tests-s3-key-id', variable: 'S3_KEY'), - string(credentialsId: 'ci-tests-s3-secret-access-key ', variable: 'S3_SECRET') - ]) { - script{ - env.CI_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/index.html' - env.CI_JSON_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/report.json' - } - sh '''#! /bin/bash - set -e - if grep -q 'docker-baseimage' <<< "${LS_REPO}"; then - echo "Detected baseimage, setting LSIO_FIRST_PARTY=true" - if [ -n "${CI_DOCKERENV}" ]; then - CI_DOCKERENV="LSIO_FIRST_PARTY=true|${CI_DOCKERENV}" - else - CI_DOCKERENV="LSIO_FIRST_PARTY=true" - fi - fi - docker pull ghcr.io/linuxserver/ci:latest - if [ "${MULTIARCH}" == "true" ]; then - docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} --platform=arm64 - docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG} - fi - docker run --rm \ - --shm-size=1gb \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -e IMAGE=\"${IMAGE}\" \ - -e DOCKER_LOGS_TIMEOUT=\"${CI_DELAY}\" \ - -e TAGS=\"${CI_TAGS}\" \ - -e META_TAG=\"${META_TAG}\" \ - -e RELEASE_TAG=\"jammy\" \ - -e PORT=\"${CI_PORT}\" \ - -e SSL=\"${CI_SSL}\" \ - -e BASE=\"${DIST_IMAGE}\" \ - -e SECRET_KEY=\"${S3_SECRET}\" \ - -e ACCESS_KEY=\"${S3_KEY}\" \ - -e DOCKER_ENV=\"${CI_DOCKERENV}\" \ - -e WEB_SCREENSHOT=\"${CI_WEB}\" \ - -e WEB_AUTH=\"${CI_AUTH}\" \ - -e WEB_PATH=\"${CI_WEBPATH}\" \ - -e NODE_NAME=\"${NODE_NAME}\" \ - -e SYFT_IMAGE_TAG=\"${CI_SYFT_IMAGE_TAG:-${SYFT_IMAGE_TAG}}\" \ - -t ghcr.io/linuxserver/ci:latest \ - python3 test_build.py''' - } - } - } - /* ################## - Release Logic - ################## */ - // If this is an amd64 only image only push a single image - stage('Docker-Push-Single') { - when { - environment name: 'MULTIARCH', value: 'false' - environment name: 'EXIT_STATUS', value: '' - } - steps { - retry_backoff(5,5) { - sh '''#! /bin/bash - set -e - for PUSHIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do - [[ ${PUSHIMAGE%%/*} =~ \\. ]] && PUSHIMAGEPLUS="${PUSHIMAGE}" || PUSHIMAGEPLUS="docker.io/${PUSHIMAGE}" - IFS=',' read -ra CACHE <<< "$BUILDCACHE" - for i in "${CACHE[@]}"; do - if [[ "${PUSHIMAGEPLUS}" == "$(cut -d "/" -f1 <<< ${i})"* ]]; then - CACHEIMAGE=${i} - fi - done - docker buildx imagetools create --prefer-index=false -t ${PUSHIMAGE}:${META_TAG} -t ${PUSHIMAGE}:jammy -t ${PUSHIMAGE}:${EXT_RELEASE_TAG} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} - if [ -n "${SEMVER}" ]; then - docker buildx imagetools create --prefer-index=false -t ${PUSHIMAGE}:${SEMVER} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} - fi - done - ''' - } - } - } - // If this is a multi arch release push all images and define the manifest - stage('Docker-Push-Multi') { - when { - environment name: 'MULTIARCH', value: 'true' - environment name: 'EXIT_STATUS', value: '' - } - steps { - retry_backoff(5,5) { - sh '''#! /bin/bash - set -e - for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do - [[ ${MANIFESTIMAGE%%/*} =~ \\. ]] && MANIFESTIMAGEPLUS="${MANIFESTIMAGE}" || MANIFESTIMAGEPLUS="docker.io/${MANIFESTIMAGE}" - IFS=',' read -ra CACHE <<< "$BUILDCACHE" - for i in "${CACHE[@]}"; do - if [[ "${MANIFESTIMAGEPLUS}" == "$(cut -d "/" -f1 <<< ${i})"* ]]; then - CACHEIMAGE=${i} - fi - done - docker buildx imagetools create --prefer-index=false -t ${MANIFESTIMAGE}:amd64-${META_TAG} -t ${MANIFESTIMAGE}:amd64-jammy -t ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} - docker buildx imagetools create --prefer-index=false -t ${MANIFESTIMAGE}:arm64v8-${META_TAG} -t ${MANIFESTIMAGE}:arm64v8-jammy -t ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} ${CACHEIMAGE}:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} - if [ -n "${SEMVER}" ]; then - docker buildx imagetools create --prefer-index=false -t ${MANIFESTIMAGE}:amd64-${SEMVER} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} - docker buildx imagetools create --prefer-index=false -t ${MANIFESTIMAGE}:arm64v8-${SEMVER} ${CACHEIMAGE}:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} - fi - done - for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do - docker buildx imagetools create -t ${MANIFESTIMAGE}:jammy ${MANIFESTIMAGE}:amd64-jammy ${MANIFESTIMAGE}:arm64v8-jammy - docker buildx imagetools create -t ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} - - docker buildx imagetools create -t ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} - if [ -n "${SEMVER}" ]; then - docker buildx imagetools create -t ${MANIFESTIMAGE}:${SEMVER} ${MANIFESTIMAGE}:amd64-${SEMVER} ${MANIFESTIMAGE}:arm64v8-${SEMVER} - fi - done - ''' - } - } - } - // If this is a public release tag it in the LS Github - stage('Github-Tag-Push-Release') { - when { - branch "jammy" - expression { - env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER - } - environment name: 'CHANGE_ID', value: '' - environment name: 'EXIT_STATUS', value: '' - } - steps { - echo "Pushing New tag for current commit ${META_TAG}" - sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \ - -d '{"tag":"'${META_TAG}'",\ - "object": "'${COMMIT_SHA}'",\ - "message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to jammy",\ - "type": "commit",\ - "tagger": {"name": "LinuxServer-CI","email": "ci@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' - echo "Pushing New release for Tag" - sh '''#! /bin/bash - echo "Updating base packages to ${PACKAGE_TAG}" > releasebody.json - echo '{"tag_name":"'${META_TAG}'",\ - "target_commitish": "jammy",\ - "name": "'${META_TAG}'",\ - "body": "**CI Report:**\\n\\n'${CI_URL:-N/A}'\\n\\n**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**Remote Changes:**\\n\\n' > start - printf '","draft": false,"prerelease": true}' >> releasebody.json - paste -d'\\0' start releasebody.json > releasebody.json.done - curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done''' - } - } - // Add protection to the release branch - stage('Github-Release-Branch-Protection') { - when { - branch "jammy" - environment name: 'CHANGE_ID', value: '' - environment name: 'EXIT_STATUS', value: '' - } - steps { - echo "Setting up protection for release branch jammy" - sh '''#! /bin/bash - curl -H "Authorization: token ${GITHUB_TOKEN}" -X PUT https://api.github.com/repos/${LS_USER}/${LS_REPO}/branches/jammy/protection \ - -d $(jq -c . << EOF - { - "required_status_checks": null, - "enforce_admins": false, - "required_pull_request_reviews": { - "dismiss_stale_reviews": false, - "require_code_owner_reviews": false, - "require_last_push_approval": false, - "required_approving_review_count": 1 - }, - "restrictions": null, - "required_linear_history": false, - "allow_force_pushes": false, - "allow_deletions": false, - "block_creations": false, - "required_conversation_resolution": true, - "lock_branch": false, - "allow_fork_syncing": false, - "required_signatures": false - } -EOF - ) ''' - } - } - // 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: 'EXIT_STATUS', value: '' - } - steps { - sh '''#! /bin/bash - # Function to retrieve JSON data from URL - get_json() { - local url="$1" - local response=$(curl -s "$url") - if [ $? -ne 0 ]; then - echo "Failed to retrieve JSON data from $url" - return 1 - fi - local json=$(echo "$response" | jq .) - if [ $? -ne 0 ]; then - echo "Failed to parse JSON data from $url" - return 1 - fi - echo "$json" - } - - build_table() { - local data="$1" - - # Get the keys in the JSON data - local keys=$(echo "$data" | jq -r 'to_entries | map(.key) | .[]') - - # Check if keys are empty - if [ -z "$keys" ]; then - echo "JSON report data does not contain any keys or the report does not exist." - return 1 - fi - - # Build table header - local header="| Tag | Passed |\\n| --- | --- |\\n" - - # Loop through the JSON data to build the table rows - local rows="" - for build in $keys; do - local status=$(echo "$data" | jq -r ".[\\"$build\\"].test_success") - if [ "$status" = "true" ]; then - status="✅" - else - status="❌" - fi - local row="| "$build" | "$status" |\\n" - rows="${rows}${row}" - done - - local table="${header}${rows}" - local escaped_table=$(echo "$table" | sed 's/\"/\\\\"/g') - echo "$escaped_table" - } - - if [[ "${CI}" = "true" ]]; then - # Retrieve JSON data from URL - data=$(get_json "$CI_JSON_URL") - # Create table from JSON data - table=$(build_table "$data") - echo -e "$table" - - curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github.v3+json" \ - "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: \\n${CI_URL}\\n${SHELLCHECK_URL}\\n${table}\\"}" - else - curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/$LS_USER/$LS_REPO/issues/$PULL_REQUEST/comments" \ - -d "{\\"body\\": \\"I am a bot, here is the pushed image/manifest for this PR: \\n\\n\\`${GITHUBIMAGE}:${META_TAG}\\`\\"}" - fi - ''' - - } - } - } - /* ###################### - Send status to Discord - ###################### */ - post { - always { - sh '''#!/bin/bash - rm -rf /config/.ssh/id_sign - rm -rf /config/.ssh/id_sign.pub - git config --global --unset gpg.format - git config --global --unset user.signingkey - git config --global --unset commit.gpgsign - ''' - script{ - env.JOB_DATE = sh( - script: '''date '+%Y-%m-%dT%H:%M:%S%:z' ''', - returnStdout: true).trim() - if (env.EXIT_STATUS == "ABORTED"){ - sh 'echo "build aborted"' - }else{ - if (currentBuild.currentResult == "SUCCESS"){ - if (env.GITHUBIMAGE =~ /lspipepr/){ - env.JOB_WEBHOOK_STATUS='Success' - env.JOB_WEBHOOK_COLOUR=3957028 - env.JOB_WEBHOOK_FOOTER='PR Build' - }else if (env.GITHUBIMAGE =~ /lsiodev/){ - env.JOB_WEBHOOK_STATUS='Success' - env.JOB_WEBHOOK_COLOUR=3957028 - env.JOB_WEBHOOK_FOOTER='Dev Build' - }else{ - env.JOB_WEBHOOK_STATUS='Success' - env.JOB_WEBHOOK_COLOUR=1681177 - env.JOB_WEBHOOK_FOOTER='Live Build' - } - }else{ - if (env.GITHUBIMAGE =~ /lspipepr/){ - env.JOB_WEBHOOK_STATUS='Failure' - env.JOB_WEBHOOK_COLOUR=12669523 - env.JOB_WEBHOOK_FOOTER='PR Build' - }else if (env.GITHUBIMAGE =~ /lsiodev/){ - env.JOB_WEBHOOK_STATUS='Failure' - env.JOB_WEBHOOK_COLOUR=12669523 - env.JOB_WEBHOOK_FOOTER='Dev Build' - }else{ - env.JOB_WEBHOOK_STATUS='Failure' - env.JOB_WEBHOOK_COLOUR=16711680 - env.JOB_WEBHOOK_FOOTER='Live Build' - } - } - sh ''' curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/jenkins-avatar.png","embeds": [{"'color'": '${JOB_WEBHOOK_COLOUR}',\ - "footer": {"text" : "'"${JOB_WEBHOOK_FOOTER}"'"},\ - "timestamp": "'${JOB_DATE}'",\ - "description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**ShellCheck Results:** '${SHELLCHECK_URL}'\\n**Status:** '${JOB_WEBHOOK_STATUS}'\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\ - "username": "Jenkins"}' ${BUILDS_DISCORD} ''' - } - } - } - cleanup { - sh '''#! /bin/bash - echo "Pruning builder!!" - docker builder prune -f --builder container || : - containers=$(docker ps -q) - if [[ -n "${containers}" ]]; then - BUILDX_CONTAINER_ID=$(docker ps -qf 'name=buildx_buildkit') - for container in ${containers}; do - if [[ "${container}" == "${BUILDX_CONTAINER_ID}" ]]; then - echo "skipping buildx container in docker stop" - else - echo "Stopping container ${container}" - docker stop ${container} - fi - done - fi - docker system prune -f --volumes || : - docker image prune -af || : - ''' - cleanWs() - } - } -} - -def retry_backoff(int max_attempts, int power_base, Closure c) { - int n = 0 - while (n < max_attempts) { - try { - c() - return - } catch (err) { - if ((n + 1) >= max_attempts) { - throw err - } - sleep(power_base ** n) - n++ - } - } - return -} diff --git a/jenkins-vars.yml b/jenkins-vars.yml deleted file mode 100644 index fbe75a86..00000000 --- a/jenkins-vars.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- - -# jenkins variables -project_name: docker-baseimage-ubuntu -external_type: os -release_type: prerelease -release_tag: jammy -ls_branch: jammy -repo_vars: - - BUILD_VERSION_ARG = 'OS' - - LS_USER = 'linuxserver' - - LS_REPO = 'docker-baseimage-ubuntu' - - CONTAINER_NAME = 'baseimage-ubuntu' - - DOCKERHUB_IMAGE = 'lsiobase/ubuntu' - - DEV_DOCKERHUB_IMAGE = 'lsiodev/ubuntu' - - PR_DOCKERHUB_IMAGE = 'lspipepr/ubuntu' - - DIST_IMAGE = 'ubuntu' - - MULTIARCH='true' - - CI='true' - - CI_WEB='false' - - CI_PORT='80' - - CI_SSL='true' - - CI_DELAY='30' - - CI_DOCKERENV='LSIO_FIRST_PARTY=true' - - CI_AUTH='' - - CI_WEBPATH='' From 6b5e13ee037abaeba9d25ade548bf79560e77e69 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Mon, 21 Jul 2025 22:48:55 -0500 Subject: [PATCH 03/36] remove source list files --- sources.list | 12 ------------ sources.list.arm | 12 ------------ 2 files changed, 24 deletions(-) delete mode 100644 sources.list delete mode 100644 sources.list.arm diff --git a/sources.list b/sources.list deleted file mode 100644 index 6763c264..00000000 --- a/sources.list +++ /dev/null @@ -1,12 +0,0 @@ -deb http://archive.ubuntu.com/ubuntu/ jammy main restricted -deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted -deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted -deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted -deb http://archive.ubuntu.com/ubuntu/ jammy universe multiverse -deb-src http://archive.ubuntu.com/ubuntu/ jammy universe multiverse -deb http://archive.ubuntu.com/ubuntu/ jammy-updates universe multiverse -deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates universe multiverse -deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted -deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted -deb http://archive.ubuntu.com/ubuntu/ jammy-security universe multiverse -deb-src http://archive.ubuntu.com/ubuntu/ jammy-security universe multiverse diff --git a/sources.list.arm b/sources.list.arm deleted file mode 100644 index 6f714192..00000000 --- a/sources.list.arm +++ /dev/null @@ -1,12 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted multiverse -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted multiverse -deb http://ports.ubuntu.com/ubuntu-ports/ jammy universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy universe -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates universe -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted multiverse -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security universe From de7f79e12d7e8344835299e8d36971b9dd3dc734 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Mon, 21 Jul 2025 22:51:50 -0500 Subject: [PATCH 04/36] remove extra files --- package_versions.txt | 146 ------------------------------------------- readme-vars.yml | 27 -------- 2 files changed, 173 deletions(-) delete mode 100755 package_versions.txt delete mode 100644 readme-vars.yml diff --git a/package_versions.txt b/package_versions.txt deleted file mode 100755 index 08ecaa74..00000000 --- a/package_versions.txt +++ /dev/null @@ -1,146 +0,0 @@ -NAME VERSION TYPE -adduser 3.118ubuntu5 deb -apt 2.4.14 deb -apt-utils 2.4.14 deb -base-files 12ubuntu4.7 deb -base-passwd 3.5.52build1 deb -bash 5.1-6ubuntu1.1 deb -bsdutils 1:2.37.2-4ubuntu3.4 deb -ca-certificates 20240203~22.04.1 deb -catatonit 0.1.7-1 deb -coreutils 8.32-4.1ubuntu1.2 deb -cron 3.0pl1-137ubuntu3 deb -curl 7.81.0-1ubuntu1.20 deb -dash 0.5.11+git20210903+057cd650a4ed-3build1 deb -debconf 1.5.79ubuntu1 deb -debianutils 5.5-1ubuntu2 deb -diffutils 1:3.8-0ubuntu2 deb -dirmngr 2.2.27-3ubuntu2.4 deb -dpkg 1.21.1ubuntu2.3 deb -e2fsprogs 1.46.5-2ubuntu1.2 deb -findutils 4.8.0-1ubuntu3 deb -gcc-12-base 12.3.0-1ubuntu1~22.04 deb -gnupg 2.2.27-3ubuntu2.4 deb -gnupg-l10n 2.2.27-3ubuntu2.4 deb -gnupg-utils 2.2.27-3ubuntu2.4 deb -gpg 2.2.27-3ubuntu2.4 deb -gpg-agent 2.2.27-3ubuntu2.4 deb -gpg-wks-client 2.2.27-3ubuntu2.4 deb -gpg-wks-server 2.2.27-3ubuntu2.4 deb -gpgconf 2.2.27-3ubuntu2.4 deb -gpgsm 2.2.27-3ubuntu2.4 deb -gpgv 2.2.27-3ubuntu2.4 deb -grep 3.7-1build1 deb -gzip 1.10-4ubuntu4.1 deb -hostname 3.23ubuntu2 deb -init-system-helpers 1.62 deb -jq 1.6-2.1ubuntu3 deb -libacl1 2.3.1-1 deb -libapt-pkg6.0 2.4.14 deb -libassuan0 2.5.5-1build1 deb -libattr1 1:2.5.1-1build1 deb -libaudit-common 1:3.0.7-1build1 deb -libaudit1 1:3.0.7-1build1 deb -libblkid1 2.37.2-4ubuntu3.4 deb -libbrotli1 1.0.9-2build6 deb -libbsd0 0.11.5-1 deb -libbz2-1.0 1.0.8-5build1 deb -libc-bin 2.35-0ubuntu3.10 deb -libc6 2.35-0ubuntu3.10 deb -libcap-ng0 0.7.9-2.2build3 deb -libcap2 1:2.44-1ubuntu0.22.04.2 deb -libcom-err2 1.46.5-2ubuntu1.2 deb -libcrypt1 1:4.4.27-1 deb -libcurl4 7.81.0-1ubuntu1.20 deb -libdb5.3 5.3.28+dfsg1-0.8ubuntu3 deb -libdebconfclient0 0.261ubuntu1 deb -libext2fs2 1.46.5-2ubuntu1.2 deb -libffi8 3.4.2-4 deb -libgcc-s1 12.3.0-1ubuntu1~22.04 deb -libgcrypt20 1.9.4-3ubuntu3 deb -libgmp10 2:6.2.1+dfsg-3ubuntu1 deb -libgnutls30 3.7.3-4ubuntu1.7 deb -libgpg-error0 1.43-3 deb -libgssapi-krb5-2 1.19.2-2ubuntu0.7 deb -libhogweed6 3.7.3-1build2 deb -libidn2-0 2.3.2-2build1 deb -libjq1 1.6-2.1ubuntu3 deb -libk5crypto3 1.19.2-2ubuntu0.7 deb -libkeyutils1 1.6.1-2ubuntu3 deb -libkrb5-3 1.19.2-2ubuntu0.7 deb -libkrb5support0 1.19.2-2ubuntu0.7 deb -libksba8 1.6.0-2ubuntu0.2 deb -libldap-2.5-0 2.5.19+dfsg-0ubuntu0.22.04.1 deb -libldap-common 2.5.19+dfsg-0ubuntu0.22.04.1 deb -liblz4-1 1.9.3-2build2 deb -liblzma5 5.2.5-2ubuntu1 deb -libmd0 1.0.4-1build1 deb -libmount1 2.37.2-4ubuntu3.4 deb -libncurses6 6.3-2ubuntu0.1 deb -libncursesw6 6.3-2ubuntu0.1 deb -libnettle8 3.7.3-1build2 deb -libnghttp2-14 1.43.0-1ubuntu0.2 deb -libnpth0 1.6-3build2 deb -libnsl2 1.3.0-2build2 deb -libonig5 6.9.7.1-2build1 deb -libp11-kit0 0.24.0-6build1 deb -libpam-modules 1.4.0-11ubuntu2.6 deb -libpam-modules-bin 1.4.0-11ubuntu2.6 deb -libpam-runtime 1.4.0-11ubuntu2.6 deb -libpam0g 1.4.0-11ubuntu2.6 deb -libpcre2-8-0 10.39-3ubuntu0.1 deb -libpcre3 2:8.39-13ubuntu0.22.04.1 deb -libprocps8 2:3.3.17-6ubuntu2.1 deb -libpsl5 0.21.0-1.2build2 deb -libreadline8 8.1.2-1 deb -librtmp1 2.4+20151223.gitfa8646d.1-2build4 deb -libsasl2-2 2.1.27+dfsg2-3ubuntu1.2 deb -libsasl2-modules 2.1.27+dfsg2-3ubuntu1.2 deb -libsasl2-modules-db 2.1.27+dfsg2-3ubuntu1.2 deb -libseccomp2 2.5.3-2ubuntu3~22.04.1 deb -libselinux1 3.3-1build2 deb -libsemanage-common 3.3-1build2 deb -libsemanage2 3.3-1build2 deb -libsepol2 3.3-1build1 deb -libsmartcols1 2.37.2-4ubuntu3.4 deb -libsqlite3-0 3.37.2-2ubuntu0.4 deb -libss2 1.46.5-2ubuntu1.2 deb -libssh-4 0.9.6-2ubuntu0.22.04.4 deb -libssl3 3.0.2-0ubuntu1.19 deb -libstdc++6 12.3.0-1ubuntu1~22.04 deb -libsystemd0 249.11-0ubuntu3.16 deb -libtasn1-6 4.18.0-4ubuntu0.1 deb -libtinfo6 6.3-2ubuntu0.1 deb -libtirpc-common 1.3.2-2ubuntu0.1 deb -libtirpc3 1.3.2-2ubuntu0.1 deb -libudev1 249.11-0ubuntu3.16 deb -libunistring2 1.0-1 deb -libuuid1 2.37.2-4ubuntu3.4 deb -libxxhash0 0.8.1-1 deb -libzstd1 1.4.8+dfsg-3build1 deb -locales 2.35-0ubuntu3.10 deb -login 1:4.8.1-2ubuntu2.2 deb -logsave 1.46.5-2ubuntu1.2 deb -lsb-base 11.1.0ubuntu4 deb -mawk 1.3.4.20200120-3 deb -mount 2.37.2-4ubuntu3.4 deb -ncurses-base 6.3-2ubuntu0.1 deb -ncurses-bin 6.3-2ubuntu0.1 deb -netcat 1.218-4ubuntu1 deb -netcat-openbsd 1.218-4ubuntu1 deb -openssl 3.0.2-0ubuntu1.19 deb -passwd 1:4.8.1-2ubuntu2.2 deb -perl-base 5.34.0-3ubuntu1.4 deb -pinentry-curses 1.1.1-1build2 deb -procps 2:3.3.17-6ubuntu2.1 deb -publicsuffix 20211207.1025-1 deb -readline-common 8.1.2-1 deb -sed 4.8-1ubuntu2 deb -sensible-utils 0.0.17 deb -sysvinit-utils 3.01-1ubuntu1 deb -tar 1.34+dfsg-1ubuntu0.1.22.04.2 deb -tzdata 2025b-0ubuntu0.22.04.1 deb -ubuntu-keyring 2021.03.26 deb -usrmerge 25ubuntu2 deb -util-linux 2.37.2-4ubuntu3.4 deb -zlib1g 1:1.2.11.dfsg-2ubuntu9.2 deb diff --git a/readme-vars.yml b/readme-vars.yml deleted file mode 100644 index aae30fa7..00000000 --- a/readme-vars.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- - -# project information -project_name: baseimage-ubuntu -full_custom_readme: | - {% raw -%} - [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io) - - ## Contact information:- - - | Type | Address/Details | - | :---: | --- | - | Discord | [Discord](https://linuxserver.io/discord) | - | IRC | `#linuxserver.io` on irc.libera.chat | - | Forum | [Discourse](https://discourse.linuxserver.io/) | - - A custom base image built with [Ubuntu Linux](https://ubuntu.com) and [s6-overlay](https://github.com/just-containers/s6-overlay). - - - Support for using our base images in your own projects is provided on a Reasonable Endeavours basis, please see our [Support Policy](https://www.linuxserver.io/supportpolicy) for details. - - There is no `latest` tag for any of our base images, by design. We often make breaking changes between versions, and we don't publish release notes like we do for the downstream images. - - If you're intending to distribute an image using one of our bases, please read our [docs on container branding](https://docs.linuxserver.io/general/container-branding/) first. - - Ubuntu releases are supported for 5 years, after which we will stop building new base images for that version. - - The following line is only in this repo for loop testing: - - - { date: "01.01.50:", desc: "I am the release message for this internal repo." } - {%- endraw %} From 1df1b47bf47cf3b6e41ca17128afdffbab9f7494 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Mon, 21 Jul 2025 23:26:43 -0500 Subject: [PATCH 05/36] remove extra files --- .env.example | 32 ++++++++++ Dockerfile.aarch64 | 150 --------------------------------------------- docker-compose.yml | 32 ++++++++++ 3 files changed, 64 insertions(+), 150 deletions(-) create mode 100644 .env.example delete mode 100644 Dockerfile.aarch64 create mode 100644 docker-compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..47e992ad --- /dev/null +++ b/.env.example @@ -0,0 +1,32 @@ +# Docker Compose Environment Variables for Ubuntu FIPS Base Image +# Copy this file to .env and modify values as needed + +# Build Arguments +BUILD_DATE=2025-01-21T00:00:00Z +VERSION=jammy-22.04 + +# S6 Overlay Configuration +S6_OVERLAY_VERSION=3.1.6.2 +S6_OVERLAY_ARCH=x86_64 +MODS_VERSION=v3 +PKG_INST_VERSION=v1 +LSIOWN_VERSION=v1 + +# Ubuntu Configuration +REL=jammy +ARCH=amd64 + +# User/Group IDs (default abc user is 911:911) +PUID=911 +PGID=911 + +# Timezone +TZ=Etc/UTC + +# Volume paths (adjust to your host paths) +CONFIG_PATH=./config +APP_PATH=./app + +# ECR Configuration (if using ECR for base images) +# ECR_ACCOUNT_ID=your-aws-account-id +# ECR_REGION=us-east-1 \ No newline at end of file diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 deleted file mode 100644 index 62b08adb..00000000 --- a/Dockerfile.aarch64 +++ /dev/null @@ -1,150 +0,0 @@ -# syntax=docker/dockerfile:1 - -FROM alpine:3 as rootfs-stage - -# environment -ENV REL=jammy -ENV ARCH=arm64 - -# install packages -RUN \ - apk add --no-cache \ - bash \ - curl \ - tzdata \ - xz - -# grab base tarball -RUN \ - mkdir /root-out && \ - curl -o \ - /rootfs.tar.gz -L \ - https://partner-images.canonical.com/core/${REL}/current/ubuntu-${REL}-core-cloudimg-${ARCH}-root.tar.gz && \ - tar xf \ - /rootfs.tar.gz -C \ - /root-out && \ - rm -rf \ - /root-out/var/log/* - -# set version for s6 overlay -ARG S6_OVERLAY_VERSION="3.1.6.2" -ARG S6_OVERLAY_ARCH="aarch64" - -# add s6 overlay -ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp -RUN tar -C /root-out -Jxpf /tmp/s6-overlay-noarch.tar.xz -ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz /tmp -RUN tar -C /root-out -Jxpf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz - -# add s6 optional symlinks -ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz /tmp -RUN tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz -ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz /tmp -RUN tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz - -# Runtime stage -FROM scratch -COPY --from=rootfs-stage /root-out/ / -ARG BUILD_DATE -ARG VERSION -ARG MODS_VERSION="v3" -ARG PKG_INST_VERSION="v1" -ARG LSIOWN_VERSION="v1" -LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="TheLamer" - -ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods" -ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run" -ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown" - -# set environment variables -ARG DEBIAN_FRONTEND="noninteractive" -ENV HOME="/root" \ - LANGUAGE="en_US.UTF-8" \ - LANG="en_US.UTF-8" \ - TERM="xterm" \ - S6_CMD_WAIT_FOR_SERVICES_MAXTIME="0" \ - S6_VERBOSITY=1 \ - S6_STAGE2_HOOK=/docker-mods \ - VIRTUAL_ENV=/lsiopy \ - PATH="/lsiopy/bin:$PATH" - -# copy sources -COPY sources.list.arm /etc/apt/sources.list - -RUN \ - echo "**** Ripped from Ubuntu Docker Logic ****" && \ - set -xe && \ - echo '#!/bin/sh' \ - > /usr/sbin/policy-rc.d && \ - echo 'exit 101' \ - >> /usr/sbin/policy-rc.d && \ - chmod +x \ - /usr/sbin/policy-rc.d && \ - dpkg-divert --local --rename --add /sbin/initctl && \ - cp -a \ - /usr/sbin/policy-rc.d \ - /sbin/initctl && \ - sed -i \ - 's/^exit.*/exit 0/' \ - /sbin/initctl && \ - echo 'force-unsafe-io' \ - > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup && \ - echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' \ - > /etc/apt/apt.conf.d/docker-clean && \ - echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' \ - >> /etc/apt/apt.conf.d/docker-clean && \ - echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' \ - >> /etc/apt/apt.conf.d/docker-clean && \ - echo 'Acquire::Languages "none";' \ - > /etc/apt/apt.conf.d/docker-no-languages && \ - echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' \ - > /etc/apt/apt.conf.d/docker-gzip-indexes && \ - echo 'Apt::AutoRemove::SuggestsImportant "false";' \ - > /etc/apt/apt.conf.d/docker-autoremove-suggests && \ - mkdir -p /run/systemd && \ - echo 'docker' \ - > /run/systemd/container && \ - echo "**** install apt-utils and locales ****" && \ - apt-get update && \ - apt-get upgrade -y && \ - apt-get install -y \ - apt-utils \ - locales && \ - echo "**** install packages ****" && \ - apt-get install -y \ - catatonit \ - cron \ - curl \ - gnupg \ - jq \ - netcat \ - tzdata && \ - echo "**** generate locale ****" && \ - locale-gen en_US.UTF-8 && \ - echo "**** create abc user and make our folders ****" && \ - useradd -u 911 -U -d /config -s /bin/false abc && \ - usermod -G users abc && \ - mkdir -p \ - /app \ - /config \ - /defaults \ - /lsiopy && \ - echo "**** add qemu ****" && \ - curl -o \ - /usr/bin/qemu-aarch64-static -L \ - "https://lsio-ci.ams3.digitaloceanspaces.com/qemu-aarch64-static" && \ - chmod +x /usr/bin/qemu-aarch64-static && \ - echo "**** cleanup ****" && \ - apt-get autoremove && \ - apt-get clean && \ - rm -rf \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/* \ - /var/log/* - -# add local files -COPY root/ / - -ENTRYPOINT ["/init"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..6e68613f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +--- +services: + ubuntu-fips: + build: + context: . + dockerfile: Dockerfile + args: + - BUILD_DATE=${BUILD_DATE:-2025-01-21T00:00:00Z} + - VERSION=${VERSION:-jammy-22.04} + - S6_OVERLAY_VERSION=${S6_OVERLAY_VERSION:-3.1.6.2} + - S6_OVERLAY_ARCH=${S6_OVERLAY_ARCH:-x86_64} + - MODS_VERSION=${MODS_VERSION:-v3} + - PKG_INST_VERSION=${PKG_INST_VERSION:-v1} + - LSIOWN_VERSION=${LSIOWN_VERSION:-v1} + - REL=${REL:-jammy} + - ARCH=${ARCH:-amd64} + image: gabemendoza1/cloudcode-baseimage-ubuntu-fips:${VERSION:-jammy-22.04} + container_name: ubuntu-fips-base + environment: + - PUID=${PUID:-911} + - PGID=${PGID:-911} + - TZ=${TZ:-Etc/UTC} + volumes: + - ${CONFIG_PATH:-./config}:/config + - ${APP_PATH:-./app}:/app + restart: unless-stopped + networks: + - ubuntu-fips-network + +networks: + ubuntu-fips-network: + driver: bridge \ No newline at end of file From 1392b01caff4e82d2e2e60f0c96b9ff61577ecbd Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Mon, 21 Jul 2025 23:56:25 -0500 Subject: [PATCH 06/36] Refactor Dockerfile to use FIPS-compliant base image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace multi-stage build with gabemendoza1/cloudcode-baseimage-ubuntu-fips:jammy-22.04 - Remove Ubuntu Cloud Image extraction and Alpine stage - Remove sources.list copy (already configured in base image) - Add s6-overlay installation for LinuxServer.io compatibility - Add LinuxServer.io mod scripts (docker-mods, package-install, lsiown) - Conditionally create abc user (911:911) if not exists - Maintain full LinuxServer.io ecosystem on FIPS foundation 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode --- Dockerfile | 147 ++++++++++++++++------------------------------------- 1 file changed, 43 insertions(+), 104 deletions(-) diff --git a/Dockerfile b/Dockerfile index dcd3bb20..e85d97ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,61 +1,49 @@ # syntax=docker/dockerfile:1 -FROM alpine:3 as rootfs-stage +FROM gabemendoza1/cloudcode-baseimage-ubuntu-fips:jammy-22.04 -# environment -ENV REL=jammy -ENV ARCH=amd64 - -# install packages -RUN \ - apk add --no-cache \ - bash \ - curl \ - tzdata \ - xz - -# grab base tarball -RUN \ - mkdir /root-out && \ - curl -o \ - /rootfs.tar.gz -L \ - https://partner-images.canonical.com/core/${REL}/current/ubuntu-${REL}-core-cloudimg-${ARCH}-root.tar.gz && \ - tar xf \ - /rootfs.tar.gz -C \ - /root-out && \ - rm -rf \ - /root-out/var/log/* - -# set version for s6 overlay -ARG S6_OVERLAY_VERSION="3.1.6.2" -ARG S6_OVERLAY_ARCH="x86_64" - -# add s6 overlay -ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp -RUN tar -C /root-out -Jxpf /tmp/s6-overlay-noarch.tar.xz -ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz /tmp -RUN tar -C /root-out -Jxpf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz - -# add s6 optional symlinks -ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz /tmp -RUN tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz -ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz /tmp -RUN tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz - -# Runtime stage -FROM scratch -COPY --from=rootfs-stage /root-out/ / +# set version labels ARG BUILD_DATE ARG VERSION ARG MODS_VERSION="v3" ARG PKG_INST_VERSION="v1" ARG LSIOWN_VERSION="v1" +ARG S6_OVERLAY_VERSION="3.1.6.2" +ARG S6_OVERLAY_ARCH="x86_64" + LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="TheLamer" +LABEL maintainer="civisanalytics" -ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods" -ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run" -ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown" +# add s6 overlay +RUN \ + echo "**** add s6 overlay ****" && \ + curl -o /tmp/s6-overlay-noarch.tar.xz -L \ + "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" && \ + tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && \ + curl -o /tmp/s6-overlay-arch.tar.xz -L \ + "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz" && \ + tar -C / -Jxpf /tmp/s6-overlay-arch.tar.xz && \ + curl -o /tmp/s6-overlay-symlinks-noarch.tar.xz -L \ + "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz" && \ + tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz && \ + curl -o /tmp/s6-overlay-symlinks-arch.tar.xz -L \ + "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz" && \ + tar -C / -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz && \ + rm -rf /tmp/s6-overlay*.tar.xz + +# add LinuxServer.io mod scripts +RUN \ + echo "**** add LinuxServer.io mod scripts ****" && \ + curl -o /docker-mods -L \ + "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" && \ + chmod +x /docker-mods && \ + mkdir -p /etc/s6-overlay/s6-rc.d/init-mods-package-install && \ + curl -o /etc/s6-overlay/s6-rc.d/init-mods-package-install/run -L \ + "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" && \ + chmod +x /etc/s6-overlay/s6-rc.d/init-mods-package-install/run && \ + curl -o /usr/bin/lsiown -L \ + "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" && \ + chmod +x /usr/bin/lsiown # set environment variables ARG DEBIAN_FRONTEND="noninteractive" @@ -69,69 +57,20 @@ ENV HOME="/root" \ VIRTUAL_ENV=/lsiopy \ PATH="/lsiopy/bin:$PATH" -# copy sources -COPY sources.list /etc/apt/ - RUN \ - echo "**** Ripped from Ubuntu Docker Logic ****" && \ - set -xe && \ - echo '#!/bin/sh' \ - > /usr/sbin/policy-rc.d && \ - echo 'exit 101' \ - >> /usr/sbin/policy-rc.d && \ - chmod +x \ - /usr/sbin/policy-rc.d && \ - dpkg-divert --local --rename --add /sbin/initctl && \ - cp -a \ - /usr/sbin/policy-rc.d \ - /sbin/initctl && \ - sed -i \ - 's/^exit.*/exit 0/' \ - /sbin/initctl && \ - echo 'force-unsafe-io' \ - > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup && \ - echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' \ - > /etc/apt/apt.conf.d/docker-clean && \ - echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' \ - >> /etc/apt/apt.conf.d/docker-clean && \ - echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' \ - >> /etc/apt/apt.conf.d/docker-clean && \ - echo 'Acquire::Languages "none";' \ - > /etc/apt/apt.conf.d/docker-no-languages && \ - echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' \ - > /etc/apt/apt.conf.d/docker-gzip-indexes && \ - echo 'Apt::AutoRemove::SuggestsImportant "false";' \ - > /etc/apt/apt.conf.d/docker-autoremove-suggests && \ - mkdir -p /run/systemd && \ - echo 'docker' \ - > /run/systemd/container && \ - echo "**** install apt-utils and locales ****" && \ - apt-get update && \ - apt-get upgrade -y && \ - apt-get install -y \ - apt-utils \ - locales && \ - echo "**** install packages ****" && \ - apt-get install -y \ - catatonit \ - cron \ - curl \ - gnupg \ - jq \ - netcat \ - tzdata && \ - echo "**** generate locale ****" && \ - locale-gen en_US.UTF-8 && \ - echo "**** create abc user and make our folders ****" && \ - useradd -u 911 -U -d /config -s /bin/false abc && \ - usermod -G users abc && \ + echo "**** setup LinuxServer.io environment ****" && \ + echo "**** create abc user and folders (if not exists) ****" && \ + if ! id abc >/dev/null 2>&1; then \ + useradd -u 911 -U -d /config -s /bin/false abc && \ + usermod -G users abc; \ + fi && \ mkdir -p \ /app \ /config \ /defaults \ /lsiopy && \ echo "**** cleanup ****" && \ - apt-get autoremove && \ + apt-get autoremove -y && \ apt-get clean && \ rm -rf \ /tmp/* \ From a9c8c78949db9e8f181757cec7def0a5e254740a Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Tue, 22 Jul 2025 05:24:05 -0500 Subject: [PATCH 07/36] cleanup docker compose --- docker-compose.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6e68613f..294d8f31 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,13 +20,3 @@ services: - PUID=${PUID:-911} - PGID=${PGID:-911} - TZ=${TZ:-Etc/UTC} - volumes: - - ${CONFIG_PATH:-./config}:/config - - ${APP_PATH:-./app}:/app - restart: unless-stopped - networks: - - ubuntu-fips-network - -networks: - ubuntu-fips-network: - driver: bridge \ No newline at end of file From fcfd50f49470011c3ea3362af730b61513779a23 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Tue, 22 Jul 2025 05:29:19 -0500 Subject: [PATCH 08/36] reduce --- docker-compose.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 294d8f31..58c0595a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,6 @@ services: context: . dockerfile: Dockerfile args: - - BUILD_DATE=${BUILD_DATE:-2025-01-21T00:00:00Z} - VERSION=${VERSION:-jammy-22.04} - S6_OVERLAY_VERSION=${S6_OVERLAY_VERSION:-3.1.6.2} - S6_OVERLAY_ARCH=${S6_OVERLAY_ARCH:-x86_64} @@ -15,8 +14,3 @@ services: - REL=${REL:-jammy} - ARCH=${ARCH:-amd64} image: gabemendoza1/cloudcode-baseimage-ubuntu-fips:${VERSION:-jammy-22.04} - container_name: ubuntu-fips-base - environment: - - PUID=${PUID:-911} - - PGID=${PGID:-911} - - TZ=${TZ:-Etc/UTC} From 04c3978ad9b252064b11247e68e81a4ad7739531 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Tue, 22 Jul 2025 06:10:39 -0500 Subject: [PATCH 09/36] python --- .env.example | 37 +++++-------------------------------- .gitignore | 1 + Dockerfile | 38 ++++++++++++++++++++++++++++++++++++-- docker-compose.yml | 10 +++++++++- 4 files changed, 51 insertions(+), 35 deletions(-) diff --git a/.env.example b/.env.example index 47e992ad..a44f335f 100644 --- a/.env.example +++ b/.env.example @@ -1,32 +1,5 @@ -# Docker Compose Environment Variables for Ubuntu FIPS Base Image -# Copy this file to .env and modify values as needed - -# Build Arguments -BUILD_DATE=2025-01-21T00:00:00Z -VERSION=jammy-22.04 - -# S6 Overlay Configuration -S6_OVERLAY_VERSION=3.1.6.2 -S6_OVERLAY_ARCH=x86_64 -MODS_VERSION=v3 -PKG_INST_VERSION=v1 -LSIOWN_VERSION=v1 - -# Ubuntu Configuration -REL=jammy -ARCH=amd64 - -# User/Group IDs (default abc user is 911:911) -PUID=911 -PGID=911 - -# Timezone -TZ=Etc/UTC - -# Volume paths (adjust to your host paths) -CONFIG_PATH=./config -APP_PATH=./app - -# ECR Configuration (if using ECR for base images) -# ECR_ACCOUNT_ID=your-aws-account-id -# ECR_REGION=us-east-1 \ No newline at end of file +# ECR Configuration for FIPS Base Image +ECR_ACCOUNT_ID=0123456789012 +ECR_REGION=us-east-999 +BASE_IMAGE_NAME=ubuntu-fips +BASE_IMAGE_TAG=22.04 diff --git a/.gitignore b/.gitignore index 6e8ad977..5df90450 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ Network Trash Folder Temporary Items .apdisk .jenkins-external +.env diff --git a/Dockerfile b/Dockerfile index e85d97ad..ca962aba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,13 @@ # syntax=docker/dockerfile:1 -FROM gabemendoza1/cloudcode-baseimage-ubuntu-fips:jammy-22.04 +# ECR and base image configuration +ARG ECR_ACCOUNT_ID=1234567890123 +ARG ECR_REGION=us-east-999 +ARG BASE_IMAGE_NAME=ubuntu-fips +ARG BASE_IMAGE_TAG=22.04 +ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} + +FROM ${ECR_URI} as ubuntu-fips-base # set version labels ARG BUILD_DATE @@ -14,8 +21,14 @@ ARG S6_OVERLAY_ARCH="x86_64" LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="civisanalytics" -# add s6 overlay +# install required packages and add s6 overlay RUN \ + echo "**** install required packages ****" && \ + apt-get update && \ + apt-get install -y \ + curl \ + ca-certificates \ + xz-utils && \ echo "**** add s6 overlay ****" && \ curl -o /tmp/s6-overlay-noarch.tar.xz -L \ "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" && \ @@ -82,3 +95,24 @@ RUN \ COPY root/ / ENTRYPOINT ["/init"] + +FROM ubuntu-fips-base as ubuntu-fips-base-python + +# Install Python 3.10 and development tools +RUN apt-get update && apt-get install -y \ + python3.10 \ + python3.10-dev \ + python3.10-venv \ + python3-pip \ + build-essential \ + libpq-dev \ + git \ + ca-certificates \ + openssl \ + libssl-dev && \ + rm -rf /var/lib/apt/lists/* && \ + # Update CA certificates to ensure SSL/TLS works properly + update-ca-certificates && \ + ln -sf /usr/bin/python3.10 /usr/bin/python && \ + ln -sf /usr/bin/python3.10 /usr/bin/python3 + diff --git a/docker-compose.yml b/docker-compose.yml index 58c0595a..ae684e15 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,13 @@ --- services: ubuntu-fips: + image: gabemendoza1/cloudcode-baseimage-ubuntu-fips:${VERSION:-jammy-22.04} build: context: . dockerfile: Dockerfile + target: ubuntu-fips-base-python + platforms: + - linux/amd64 args: - VERSION=${VERSION:-jammy-22.04} - S6_OVERLAY_VERSION=${S6_OVERLAY_VERSION:-3.1.6.2} @@ -13,4 +17,8 @@ services: - LSIOWN_VERSION=${LSIOWN_VERSION:-v1} - REL=${REL:-jammy} - ARCH=${ARCH:-amd64} - image: gabemendoza1/cloudcode-baseimage-ubuntu-fips:${VERSION:-jammy-22.04} + - ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} + - ECR_REGION=${ECR_REGION:-us-east-1} + - BASE_IMAGE_NAME=${BASE_IMAGE_NAME} + - BASE_IMAGE_TAG=${BASE_IMAGE_TAG:-22.04} + From 9a8afff75b63047287dc0d056cefefb283c4e8f4 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Tue, 22 Jul 2025 06:21:29 -0500 Subject: [PATCH 10/36] save --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ae684e15..77f13ba1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ --- services: - ubuntu-fips: - image: gabemendoza1/cloudcode-baseimage-ubuntu-fips:${VERSION:-jammy-22.04} + docker-linux-server-ubuntu-fips: + image: gabemendoza1/docker-linuxserver-ubuntu-fips:${VERSION:-jammy-22.04} build: context: . dockerfile: Dockerfile From 615908a4e20dfeb5db045d798f52f7b1f20a9ac9 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Tue, 22 Jul 2025 07:37:24 -0500 Subject: [PATCH 11/36] save --- Dockerfile | 168 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 101 insertions(+), 67 deletions(-) diff --git a/Dockerfile b/Dockerfile index ca962aba..5a114ae3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,33 @@ ARG BASE_IMAGE_NAME=ubuntu-fips ARG BASE_IMAGE_TAG=22.04 ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} -FROM ${ECR_URI} as ubuntu-fips-base +FROM ${ECR_URI} as ubuntu-fips-python +ENV REL=jammy +ENV ARCH=amd64 + +# Install Python 3.10 and development tools +RUN apt-get update && apt-get install -y \ + curl \ + tzdata \ + python3.10 \ + python3.10-dev \ + python3.10-venv \ + python3-pip \ + build-essential \ + libpq-dev \ + git \ + ca-certificates \ + openssl \ + xz-utils \ + libssl-dev && \ + rm -rf /var/lib/apt/lists/* && \ + # Update CA certificates to ensure SSL/TLS works properly + update-ca-certificates && \ + ln -sf /usr/bin/python3.10 /usr/bin/python && \ + ln -sf /usr/bin/python3.10 /usr/bin/python3 + + +FROM ubuntu-fips-python as ubuntu-fips-python-s6-mods # set version labels ARG BUILD_DATE @@ -18,49 +44,26 @@ ARG LSIOWN_VERSION="v1" ARG S6_OVERLAY_VERSION="3.1.6.2" ARG S6_OVERLAY_ARCH="x86_64" -LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="civisanalytics" +# add s6 overlay +ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp +RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz +ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz /tmp +RUN tar -C / -Jxpf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz -# install required packages and add s6 overlay -RUN \ - echo "**** install required packages ****" && \ - apt-get update && \ - apt-get install -y \ - curl \ - ca-certificates \ - xz-utils && \ - echo "**** add s6 overlay ****" && \ - curl -o /tmp/s6-overlay-noarch.tar.xz -L \ - "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" && \ - tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && \ - curl -o /tmp/s6-overlay-arch.tar.xz -L \ - "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz" && \ - tar -C / -Jxpf /tmp/s6-overlay-arch.tar.xz && \ - curl -o /tmp/s6-overlay-symlinks-noarch.tar.xz -L \ - "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz" && \ - tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz && \ - curl -o /tmp/s6-overlay-symlinks-arch.tar.xz -L \ - "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz" && \ - tar -C / -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz && \ - rm -rf /tmp/s6-overlay*.tar.xz +# add s6 optional symlinks +ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz /tmp +RUN tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz +ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz /tmp +RUN tar -C / -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz +ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods" +ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run" +ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown" -# add LinuxServer.io mod scripts -RUN \ - echo "**** add LinuxServer.io mod scripts ****" && \ - curl -o /docker-mods -L \ - "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" && \ - chmod +x /docker-mods && \ - mkdir -p /etc/s6-overlay/s6-rc.d/init-mods-package-install && \ - curl -o /etc/s6-overlay/s6-rc.d/init-mods-package-install/run -L \ - "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" && \ - chmod +x /etc/s6-overlay/s6-rc.d/init-mods-package-install/run && \ - curl -o /usr/bin/lsiown -L \ - "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" && \ - chmod +x /usr/bin/lsiown +FROM ubuntu-fips-python-s6-mods as ubuntu-fips-base # set environment variables ARG DEBIAN_FRONTEND="noninteractive" -ENV HOME="/root" \ +ENV HOME="/workspace" \ LANGUAGE="en_US.UTF-8" \ LANG="en_US.UTF-8" \ TERM="xterm" \ @@ -71,19 +74,66 @@ ENV HOME="/root" \ PATH="/lsiopy/bin:$PATH" RUN \ - echo "**** setup LinuxServer.io environment ****" && \ - echo "**** create abc user and folders (if not exists) ****" && \ - if ! id abc >/dev/null 2>&1; then \ - useradd -u 911 -U -d /config -s /bin/false abc && \ - usermod -G users abc; \ - fi && \ + echo "**** Ripped from Ubuntu Docker Logic ****" && \ + set -xe && \ + echo '#!/bin/sh' \ + > /usr/sbin/policy-rc.d && \ + echo 'exit 101' \ + >> /usr/sbin/policy-rc.d && \ + chmod +x \ + /usr/sbin/policy-rc.d && \ + dpkg-divert --local --rename --add /sbin/initctl && \ + cp -a \ + /usr/sbin/policy-rc.d \ + /sbin/initctl && \ + sed -i \ + 's/^exit.*/exit 0/' \ + /sbin/initctl && \ + echo 'force-unsafe-io' \ + > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup && \ + echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' \ + > /etc/apt/apt.conf.d/docker-clean && \ + echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' \ + >> /etc/apt/apt.conf.d/docker-clean && \ + echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' \ + >> /etc/apt/apt.conf.d/docker-clean && \ + echo 'Acquire::Languages "none";' \ + > /etc/apt/apt.conf.d/docker-no-languages && \ + echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' \ + > /etc/apt/apt.conf.d/docker-gzip-indexes && \ + echo 'Apt::AutoRemove::SuggestsImportant "false";' \ + > /etc/apt/apt.conf.d/docker-autoremove-suggests && \ + mkdir -p /run/systemd && \ + echo 'docker' \ + > /run/systemd/container && \ + echo "**** install apt-utils and locales ****" && \ + apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y \ + apt-utils \ + locales && \ + echo "**** install packages ****" && \ + apt-get install -y \ + catatonit \ + cron \ + curl \ + gnupg \ + jq \ + netcat \ + tzdata && \ + echo "**** generate locale ****" && \ + locale-gen en_US.UTF-8 && \ + echo "**** create abc user and make our folders ****" && \ + useradd -u 911 -U -d /workspace -s /bin/false abc && \ + usermod -G users abc && \ mkdir -p \ /app \ /config \ /defaults \ + /workspace \ /lsiopy && \ echo "**** cleanup ****" && \ - apt-get autoremove -y && \ + apt-get autoremove && \ apt-get clean && \ rm -rf \ /tmp/* \ @@ -91,28 +141,12 @@ RUN \ /var/tmp/* \ /var/log/* +FROM ubuntu-fips-base as ubuntu-fips-base-python + +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="civisanalytics" + # add local files COPY root/ / ENTRYPOINT ["/init"] - -FROM ubuntu-fips-base as ubuntu-fips-base-python - -# Install Python 3.10 and development tools -RUN apt-get update && apt-get install -y \ - python3.10 \ - python3.10-dev \ - python3.10-venv \ - python3-pip \ - build-essential \ - libpq-dev \ - git \ - ca-certificates \ - openssl \ - libssl-dev && \ - rm -rf /var/lib/apt/lists/* && \ - # Update CA certificates to ensure SSL/TLS works properly - update-ca-certificates && \ - ln -sf /usr/bin/python3.10 /usr/bin/python && \ - ln -sf /usr/bin/python3.10 /usr/bin/python3 - From bfe0aadf4f029175ef6d9af568e5ffce19b24371 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Tue, 22 Jul 2025 07:58:23 -0500 Subject: [PATCH 12/36] optmized installs --- Dockerfile | 36 ++++++++++++++++-------------------- docker-compose.yml | 2 +- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5a114ae3..8d953379 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,19 @@ ARG BASE_IMAGE_NAME=ubuntu-fips ARG BASE_IMAGE_TAG=22.04 ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} -FROM ${ECR_URI} as ubuntu-fips-python +FROM ${ECR_URI} as ubuntu-fips-python-s6 +# set version labels +ARG BUILD_DATE +ARG VERSION +ARG MODS_VERSION="v3" +ARG PKG_INST_VERSION="v1" +ARG LSIOWN_VERSION="v1" +ARG S6_OVERLAY_VERSION="3.1.6.2" +ARG S6_OVERLAY_ARCH="x86_64" + +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="civisanalytics" + ENV REL=jammy ENV ARCH=amd64 @@ -32,18 +44,6 @@ RUN apt-get update && apt-get install -y \ ln -sf /usr/bin/python3.10 /usr/bin/python && \ ln -sf /usr/bin/python3.10 /usr/bin/python3 - -FROM ubuntu-fips-python as ubuntu-fips-python-s6-mods - -# set version labels -ARG BUILD_DATE -ARG VERSION -ARG MODS_VERSION="v3" -ARG PKG_INST_VERSION="v1" -ARG LSIOWN_VERSION="v1" -ARG S6_OVERLAY_VERSION="3.1.6.2" -ARG S6_OVERLAY_ARCH="x86_64" - # add s6 overlay ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz @@ -55,11 +55,13 @@ ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLA RUN tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz /tmp RUN tar -C / -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz + +# add mods ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods" ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run" ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown" -FROM ubuntu-fips-python-s6-mods as ubuntu-fips-base +FROM ubuntu-fips-python-s6 as linuxserver-python-base # set environment variables ARG DEBIAN_FRONTEND="noninteractive" @@ -141,12 +143,6 @@ RUN \ /var/tmp/* \ /var/log/* -FROM ubuntu-fips-base as ubuntu-fips-base-python - -LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="civisanalytics" - -# add local files COPY root/ / ENTRYPOINT ["/init"] diff --git a/docker-compose.yml b/docker-compose.yml index 77f13ba1..568d4860 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: build: context: . dockerfile: Dockerfile - target: ubuntu-fips-base-python + target: linuxserver-python-base platforms: - linux/amd64 args: From 647ece9c8e5ec6b5d80f9a6d11200c462da20034 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Tue, 22 Jul 2025 17:26:01 -0500 Subject: [PATCH 13/36] remove more workflows --- .github/workflows/call_issue_pr_tracker.yml | 19 ------------------- .github/workflows/call_issues_cron.yml | 16 ---------------- .github/workflows/greetings.yml | 19 ------------------- 3 files changed, 54 deletions(-) delete mode 100755 .github/workflows/call_issue_pr_tracker.yml delete mode 100755 .github/workflows/call_issues_cron.yml delete mode 100755 .github/workflows/greetings.yml diff --git a/.github/workflows/call_issue_pr_tracker.yml b/.github/workflows/call_issue_pr_tracker.yml deleted file mode 100755 index d07cf121..00000000 --- a/.github/workflows/call_issue_pr_tracker.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Issue & PR Tracker - -on: - issues: - types: [opened,reopened,labeled,unlabeled,closed] - pull_request_target: - types: [opened,reopened,review_requested,review_request_removed,labeled,unlabeled,closed] - pull_request_review: - types: [submitted,edited,dismissed] - -permissions: - contents: read - -jobs: - manage-project: - permissions: - issues: write - uses: linuxserver/github-workflows/.github/workflows/issue-pr-tracker.yml@v1 - secrets: inherit diff --git a/.github/workflows/call_issues_cron.yml b/.github/workflows/call_issues_cron.yml deleted file mode 100755 index 227f1d3b..00000000 --- a/.github/workflows/call_issues_cron.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Mark stale issues and pull requests -on: - schedule: - - cron: '13 7 * * *' - workflow_dispatch: - -permissions: - contents: read - -jobs: - stale: - permissions: - issues: write - pull-requests: write - uses: linuxserver/github-workflows/.github/workflows/issues-cron.yml@v1 - secrets: inherit diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml deleted file mode 100755 index e19ddc16..00000000 --- a/.github/workflows/greetings.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Greetings - -on: [pull_request_target, issues] - -permissions: - contents: read - -jobs: - greeting: - permissions: - issues: write - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: actions/first-interaction@v1 - with: - issue-message: 'Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.' - pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-baseimage-ubuntu/blob/jammy/.github/PULL_REQUEST_TEMPLATE.md)!' - repo-token: ${{ secrets.GITHUB_TOKEN }} From b041b3150a681828ca80610e8727908ae74571c7 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 15:43:27 -0500 Subject: [PATCH 14/36] remove Python dependencies from Ubuntu FIPS base image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode --- Dockerfile | 22 +++++++--------------- buildspec/merge_master.yaml | 14 ++++++++++++++ buildspec/push.yaml | 19 +++++++++++++++++++ buildspec/release.yaml | 17 +++++++++++++++++ docker-compose.yml | 2 +- 5 files changed, 58 insertions(+), 16 deletions(-) create mode 100644 buildspec/merge_master.yaml create mode 100644 buildspec/push.yaml create mode 100644 buildspec/release.yaml diff --git a/Dockerfile b/Dockerfile index 8d953379..ba77ce25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ARG BASE_IMAGE_NAME=ubuntu-fips ARG BASE_IMAGE_TAG=22.04 ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} -FROM ${ECR_URI} as ubuntu-fips-python-s6 +FROM ${ECR_URI} as ubuntu-fips-s6 # set version labels ARG BUILD_DATE ARG VERSION @@ -23,14 +23,10 @@ LABEL maintainer="civisanalytics" ENV REL=jammy ENV ARCH=amd64 -# Install Python 3.10 and development tools +# Install base development tools (no Python) RUN apt-get update && apt-get install -y \ curl \ tzdata \ - python3.10 \ - python3.10-dev \ - python3.10-venv \ - python3-pip \ build-essential \ libpq-dev \ git \ @@ -38,11 +34,10 @@ RUN apt-get update && apt-get install -y \ openssl \ xz-utils \ libssl-dev && \ + # Clean up rm -rf /var/lib/apt/lists/* && \ # Update CA certificates to ensure SSL/TLS works properly - update-ca-certificates && \ - ln -sf /usr/bin/python3.10 /usr/bin/python && \ - ln -sf /usr/bin/python3.10 /usr/bin/python3 + update-ca-certificates # add s6 overlay ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp @@ -61,7 +56,7 @@ ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-s ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run" ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown" -FROM ubuntu-fips-python-s6 as linuxserver-python-base +FROM ubuntu-fips-s6 as linuxserver-base # set environment variables ARG DEBIAN_FRONTEND="noninteractive" @@ -71,9 +66,7 @@ ENV HOME="/workspace" \ TERM="xterm" \ S6_CMD_WAIT_FOR_SERVICES_MAXTIME="0" \ S6_VERBOSITY=1 \ - S6_STAGE2_HOOK=/docker-mods \ - VIRTUAL_ENV=/lsiopy \ - PATH="/lsiopy/bin:$PATH" + S6_STAGE2_HOOK=/docker-mods RUN \ echo "**** Ripped from Ubuntu Docker Logic ****" && \ @@ -132,8 +125,7 @@ RUN \ /app \ /config \ /defaults \ - /workspace \ - /lsiopy && \ + /workspace && \ echo "**** cleanup ****" && \ apt-get autoremove && \ apt-get clean && \ diff --git a/buildspec/merge_master.yaml b/buildspec/merge_master.yaml new file mode 100644 index 00000000..27fcd9db --- /dev/null +++ b/buildspec/merge_master.yaml @@ -0,0 +1,14 @@ +version: 0.2 +phases: + pre_build: + commands: + - echo Logging in to Amazon ECR... + - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} + build: + commands: + - echo Building the Docker image... + - docker build -t ${FIPS_REPOSITORY_URI}:latest . + - docker image push --all-tags ${FIPS_REPOSITORY_URI} + post_build: + commands: + - echo Build completed! diff --git a/buildspec/push.yaml b/buildspec/push.yaml new file mode 100644 index 00000000..0f10bc46 --- /dev/null +++ b/buildspec/push.yaml @@ -0,0 +1,19 @@ +version: 0.2 +phases: + build: + commands: + - echo Logging in to Amazon ECR... + - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} + - export COMMIT_HASH_SHORT="$(echo $COMMIT_HASH | cut -c 1-7)" + - echo Building the Docker image... + - echo $FIPS_REPOSITORY_URI + - echo $COMMIT_HASH_SHORT + - echo $BRANCH_NAME + - docker build --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME} . + # We have a life cycle policy in place to expire and delete images from dev branches, + # so there are no issues with pushing as many of these images as there may be. + - docker image push --all-tags ${FIPS_REPOSITORY_URI} + post_build: + commands: + - echo Build completed! + - printf '{"tag":"%s"}' $COMMIT_HASH_SHORT > build.json diff --git a/buildspec/release.yaml b/buildspec/release.yaml new file mode 100644 index 00000000..add63840 --- /dev/null +++ b/buildspec/release.yaml @@ -0,0 +1,17 @@ + +version: 0.2 +phases: + build: + commands: + - echo Logging in to Amazon ECR... + - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} + - echo Building the Docker image... + - PATCH_TAG=${TAG_NAME#"v"} # major.minor.patch + - MINOR_TAG=${PATCH_TAG%.*} # major.minor + - MAJOR_TAG=${MINOR_TAG%.*} # major + - docker build -t ${FIPS_REPOSITORY_URI}:${PATCH_TAG} -t ${FIPS_REPOSITORY_URI}:${MINOR_TAG} -t ${FIPS_REPOSITORY_URI}:${MAJOR_TAG} . + - docker image push --all-tags ${FIPS_REPOSITORY_URI} + post_build: + commands: + - echo Build completed! + - printf '{"tag":"%s"}' $TAG_NAME > build.json diff --git a/docker-compose.yml b/docker-compose.yml index 568d4860..24cb2966 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: build: context: . dockerfile: Dockerfile - target: linuxserver-python-base + target: linuxserver-base platforms: - linux/amd64 args: From a2f07db87d42742e852dce832e9deadb8d39fe4b Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 16:00:32 -0500 Subject: [PATCH 15/36] build in codebuild --- Dockerfile | 10 +++++----- buildspec/merge_master.yaml | 7 ++++++- buildspec/push.yaml | 7 ++++++- buildspec/release.yaml | 7 ++++++- docker-compose.yml | 1 - 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index ba77ce25..cedabe34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ # syntax=docker/dockerfile:1 -# ECR and base image configuration -ARG ECR_ACCOUNT_ID=1234567890123 -ARG ECR_REGION=us-east-999 -ARG BASE_IMAGE_NAME=ubuntu-fips +# ECR and base image configuration - extracted from CodeBuild environment +ARG ECR_ACCOUNT_ID +ARG ECR_REGION +ARG BASE_IMAGE_NAME=civis-ubuntu-fips ARG BASE_IMAGE_TAG=22.04 -ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} +ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} FROM ${ECR_URI} as ubuntu-fips-s6 # set version labels diff --git a/buildspec/merge_master.yaml b/buildspec/merge_master.yaml index 27fcd9db..ea48d5ba 100644 --- a/buildspec/merge_master.yaml +++ b/buildspec/merge_master.yaml @@ -4,10 +4,15 @@ phases: commands: - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} + # Extract ECR account ID and region from FIPS_REPOSITORY_URI + - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" + - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" + - echo "ECR Account ID: $ECR_ACCOUNT_ID" + - echo "ECR Region: $ECR_REGION" build: commands: - echo Building the Docker image... - - docker build -t ${FIPS_REPOSITORY_URI}:latest . + - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} -t ${FIPS_REPOSITORY_URI}:latest . - docker image push --all-tags ${FIPS_REPOSITORY_URI} post_build: commands: diff --git a/buildspec/push.yaml b/buildspec/push.yaml index 0f10bc46..852e1e52 100644 --- a/buildspec/push.yaml +++ b/buildspec/push.yaml @@ -5,11 +5,16 @@ phases: - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} - export COMMIT_HASH_SHORT="$(echo $COMMIT_HASH | cut -c 1-7)" + # Extract ECR account ID and region from FIPS_REPOSITORY_URI + - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" + - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" - echo Building the Docker image... - echo $FIPS_REPOSITORY_URI - echo $COMMIT_HASH_SHORT - echo $BRANCH_NAME - - docker build --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME} . + - echo "ECR Account ID: $ECR_ACCOUNT_ID" + - echo "ECR Region: $ECR_REGION" + - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME} . # We have a life cycle policy in place to expire and delete images from dev branches, # so there are no issues with pushing as many of these images as there may be. - docker image push --all-tags ${FIPS_REPOSITORY_URI} diff --git a/buildspec/release.yaml b/buildspec/release.yaml index add63840..a6c74771 100644 --- a/buildspec/release.yaml +++ b/buildspec/release.yaml @@ -5,11 +5,16 @@ phases: commands: - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} + # Extract ECR account ID and region from FIPS_REPOSITORY_URI + - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" + - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" + - echo "ECR Account ID: $ECR_ACCOUNT_ID" + - echo "ECR Region: $ECR_REGION" - echo Building the Docker image... - PATCH_TAG=${TAG_NAME#"v"} # major.minor.patch - MINOR_TAG=${PATCH_TAG%.*} # major.minor - MAJOR_TAG=${MINOR_TAG%.*} # major - - docker build -t ${FIPS_REPOSITORY_URI}:${PATCH_TAG} -t ${FIPS_REPOSITORY_URI}:${MINOR_TAG} -t ${FIPS_REPOSITORY_URI}:${MAJOR_TAG} . + - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} -t ${FIPS_REPOSITORY_URI}:${PATCH_TAG} -t ${FIPS_REPOSITORY_URI}:${MINOR_TAG} -t ${FIPS_REPOSITORY_URI}:${MAJOR_TAG} . - docker image push --all-tags ${FIPS_REPOSITORY_URI} post_build: commands: diff --git a/docker-compose.yml b/docker-compose.yml index 24cb2966..25bcb60b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,6 @@ --- services: docker-linux-server-ubuntu-fips: - image: gabemendoza1/docker-linuxserver-ubuntu-fips:${VERSION:-jammy-22.04} build: context: . dockerfile: Dockerfile From 3a557ca3ad4c8bfec54b0a929ab1fc754ce985c6 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 16:02:31 -0500 Subject: [PATCH 16/36] fixed buildspec --- buildspec/push.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/buildspec/push.yaml b/buildspec/push.yaml index 852e1e52..3ff2cc78 100644 --- a/buildspec/push.yaml +++ b/buildspec/push.yaml @@ -5,18 +5,15 @@ phases: - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} - export COMMIT_HASH_SHORT="$(echo $COMMIT_HASH | cut -c 1-7)" - # Extract ECR account ID and region from FIPS_REPOSITORY_URI - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" - echo Building the Docker image... - echo $FIPS_REPOSITORY_URI - echo $COMMIT_HASH_SHORT - echo $BRANCH_NAME - - echo "ECR Account ID: $ECR_ACCOUNT_ID" - - echo "ECR Region: $ECR_REGION" + - echo "ECR Account ID:" $ECR_ACCOUNT_ID + - echo "ECR Region:" $ECR_REGION - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME} . - # We have a life cycle policy in place to expire and delete images from dev branches, - # so there are no issues with pushing as many of these images as there may be. - docker image push --all-tags ${FIPS_REPOSITORY_URI} post_build: commands: From 586b85aa0d204ba2b911fb3e0b0a329f4af192b2 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 16:04:16 -0500 Subject: [PATCH 17/36] update merge_master.yaml and release.yaml --- buildspec/merge_master.yaml | 5 ++--- buildspec/release.yaml | 11 +++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/buildspec/merge_master.yaml b/buildspec/merge_master.yaml index ea48d5ba..37d0c57d 100644 --- a/buildspec/merge_master.yaml +++ b/buildspec/merge_master.yaml @@ -4,11 +4,10 @@ phases: commands: - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} - # Extract ECR account ID and region from FIPS_REPOSITORY_URI - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" - - echo "ECR Account ID: $ECR_ACCOUNT_ID" - - echo "ECR Region: $ECR_REGION" + - echo "ECR Account ID:" $ECR_ACCOUNT_ID + - echo "ECR Region:" $ECR_REGION build: commands: - echo Building the Docker image... diff --git a/buildspec/release.yaml b/buildspec/release.yaml index a6c74771..5b2157c3 100644 --- a/buildspec/release.yaml +++ b/buildspec/release.yaml @@ -5,15 +5,14 @@ phases: commands: - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} - # Extract ECR account ID and region from FIPS_REPOSITORY_URI - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" - - echo "ECR Account ID: $ECR_ACCOUNT_ID" - - echo "ECR Region: $ECR_REGION" + - echo "ECR Account ID:" $ECR_ACCOUNT_ID + - echo "ECR Region:" $ECR_REGION - echo Building the Docker image... - - PATCH_TAG=${TAG_NAME#"v"} # major.minor.patch - - MINOR_TAG=${PATCH_TAG%.*} # major.minor - - MAJOR_TAG=${MINOR_TAG%.*} # major + - PATCH_TAG=${TAG_NAME#"v"} + - MINOR_TAG=${PATCH_TAG%.*} + - MAJOR_TAG=${MINOR_TAG%.*} - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} -t ${FIPS_REPOSITORY_URI}:${PATCH_TAG} -t ${FIPS_REPOSITORY_URI}:${MINOR_TAG} -t ${FIPS_REPOSITORY_URI}:${MAJOR_TAG} . - docker image push --all-tags ${FIPS_REPOSITORY_URI} post_build: From 7fad283fe67079a9ec620a1118c12a97171745ec Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 16:10:41 -0500 Subject: [PATCH 18/36] docker build kit --- buildspec/merge_master.yaml | 1 + buildspec/push.yaml | 3 +++ buildspec/release.yaml | 3 +++ 3 files changed, 7 insertions(+) diff --git a/buildspec/merge_master.yaml b/buildspec/merge_master.yaml index 37d0c57d..789f6f48 100644 --- a/buildspec/merge_master.yaml +++ b/buildspec/merge_master.yaml @@ -2,6 +2,7 @@ version: 0.2 phases: pre_build: commands: + - export DOCKER_BUILDKIT=1 - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" diff --git a/buildspec/push.yaml b/buildspec/push.yaml index 3ff2cc78..0a4c59e1 100644 --- a/buildspec/push.yaml +++ b/buildspec/push.yaml @@ -1,5 +1,8 @@ version: 0.2 phases: + pre_build: + commands: + - export DOCKER_BUILDKIT=1 build: commands: - echo Logging in to Amazon ECR... diff --git a/buildspec/release.yaml b/buildspec/release.yaml index 5b2157c3..5639300e 100644 --- a/buildspec/release.yaml +++ b/buildspec/release.yaml @@ -1,6 +1,9 @@ version: 0.2 phases: + pre_build: + commands: + - export DOCKER_BUILDKIT=1 build: commands: - echo Logging in to Amazon ECR... From 1e75063b2b9f40f444b487accd8ce6150b47241d Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 16:12:15 -0500 Subject: [PATCH 19/36] remove echos --- buildspec/merge_master.yaml | 2 -- buildspec/push.yaml | 3 --- buildspec/release.yaml | 3 --- 3 files changed, 8 deletions(-) diff --git a/buildspec/merge_master.yaml b/buildspec/merge_master.yaml index 789f6f48..92fa9fa4 100644 --- a/buildspec/merge_master.yaml +++ b/buildspec/merge_master.yaml @@ -7,8 +7,6 @@ phases: - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" - - echo "ECR Account ID:" $ECR_ACCOUNT_ID - - echo "ECR Region:" $ECR_REGION build: commands: - echo Building the Docker image... diff --git a/buildspec/push.yaml b/buildspec/push.yaml index 0a4c59e1..dd8b6529 100644 --- a/buildspec/push.yaml +++ b/buildspec/push.yaml @@ -11,11 +11,8 @@ phases: - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" - echo Building the Docker image... - - echo $FIPS_REPOSITORY_URI - echo $COMMIT_HASH_SHORT - echo $BRANCH_NAME - - echo "ECR Account ID:" $ECR_ACCOUNT_ID - - echo "ECR Region:" $ECR_REGION - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME} . - docker image push --all-tags ${FIPS_REPOSITORY_URI} post_build: diff --git a/buildspec/release.yaml b/buildspec/release.yaml index 5639300e..e6965e61 100644 --- a/buildspec/release.yaml +++ b/buildspec/release.yaml @@ -10,9 +10,6 @@ phases: - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" - - echo "ECR Account ID:" $ECR_ACCOUNT_ID - - echo "ECR Region:" $ECR_REGION - - echo Building the Docker image... - PATCH_TAG=${TAG_NAME#"v"} - MINOR_TAG=${PATCH_TAG%.*} - MAJOR_TAG=${MINOR_TAG%.*} From 23d5bd91157d81f5211d4a8e329eb72db1c72b70 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 16:40:04 -0500 Subject: [PATCH 20/36] set ecr image tag name and related things --- Dockerfile | 4 ++-- docker-compose.yml | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index cedabe34..09697b30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ # syntax=docker/dockerfile:1 # ECR and base image configuration - extracted from CodeBuild environment -ARG ECR_ACCOUNT_ID -ARG ECR_REGION +ARG ECR_ACCOUNT_ID=0123456789012 +ARG ECR_REGION=us-east-1 ARG BASE_IMAGE_NAME=civis-ubuntu-fips ARG BASE_IMAGE_TAG=22.04 ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} diff --git a/docker-compose.yml b/docker-compose.yml index 25bcb60b..336b4506 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ --- services: - docker-linux-server-ubuntu-fips: + docker-linuxserver-ubuntu-fips: + image: ${ECR_ACCOUNT_ID:-123456789012}.dkr.ecr-fips.us-east-1.amazonaws.com/docker-linuxserver-ubuntu-fips:${IMAGE_TAG:-local} build: context: . dockerfile: Dockerfile @@ -18,6 +19,6 @@ services: - ARCH=${ARCH:-amd64} - ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} - ECR_REGION=${ECR_REGION:-us-east-1} - - BASE_IMAGE_NAME=${BASE_IMAGE_NAME} + - BASE_IMAGE_NAME=${BASE_IMAGE_NAME:-ubuntu-fips} - BASE_IMAGE_TAG=${BASE_IMAGE_TAG:-22.04} - + pull_policy: build From 85e708bda1780c42faed6072732ad1c819b7f081 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 16:55:51 -0500 Subject: [PATCH 21/36] update buildspec defs --- Dockerfile | 2 +- buildspec/merge_master.yaml | 4 ++-- buildspec/push.yaml | 4 ++-- buildspec/release.yaml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 09697b30..d6540644 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # ECR and base image configuration - extracted from CodeBuild environment ARG ECR_ACCOUNT_ID=0123456789012 ARG ECR_REGION=us-east-1 -ARG BASE_IMAGE_NAME=civis-ubuntu-fips +ARG BASE_IMAGE_NAME=docker-linuxserver-ubuntu-fips ARG BASE_IMAGE_TAG=22.04 ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} diff --git a/buildspec/merge_master.yaml b/buildspec/merge_master.yaml index 92fa9fa4..26f473ef 100644 --- a/buildspec/merge_master.yaml +++ b/buildspec/merge_master.yaml @@ -3,12 +3,12 @@ phases: pre_build: commands: - export DOCKER_BUILDKIT=1 - - echo Logging in to Amazon ECR... - - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" build: commands: + - echo Logging in to Amazon ECR... + - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} - echo Building the Docker image... - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} -t ${FIPS_REPOSITORY_URI}:latest . - docker image push --all-tags ${FIPS_REPOSITORY_URI} diff --git a/buildspec/push.yaml b/buildspec/push.yaml index dd8b6529..873c8e82 100644 --- a/buildspec/push.yaml +++ b/buildspec/push.yaml @@ -3,13 +3,13 @@ phases: pre_build: commands: - export DOCKER_BUILDKIT=1 + - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" + - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" build: commands: - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} - export COMMIT_HASH_SHORT="$(echo $COMMIT_HASH | cut -c 1-7)" - - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" - - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" - echo Building the Docker image... - echo $COMMIT_HASH_SHORT - echo $BRANCH_NAME diff --git a/buildspec/release.yaml b/buildspec/release.yaml index e6965e61..7b31da19 100644 --- a/buildspec/release.yaml +++ b/buildspec/release.yaml @@ -4,12 +4,12 @@ phases: pre_build: commands: - export DOCKER_BUILDKIT=1 + - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" + - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" build: commands: - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} - - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" - - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" - PATCH_TAG=${TAG_NAME#"v"} - MINOR_TAG=${PATCH_TAG%.*} - MAJOR_TAG=${MINOR_TAG%.*} From 198d9258e44e114e74c2db8edf79905fdccc15be Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 16:56:32 -0500 Subject: [PATCH 22/36] base image name --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d6540644..09697b30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # ECR and base image configuration - extracted from CodeBuild environment ARG ECR_ACCOUNT_ID=0123456789012 ARG ECR_REGION=us-east-1 -ARG BASE_IMAGE_NAME=docker-linuxserver-ubuntu-fips +ARG BASE_IMAGE_NAME=civis-ubuntu-fips ARG BASE_IMAGE_TAG=22.04 ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} From 3b8c1d5ac0006fdd8b79a670c210c5e1d7f6743f Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 17:05:00 -0500 Subject: [PATCH 23/36] remove extra compose args --- docker-compose.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 336b4506..1612a71c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,4 @@ services: - REL=${REL:-jammy} - ARCH=${ARCH:-amd64} - ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} - - ECR_REGION=${ECR_REGION:-us-east-1} - - BASE_IMAGE_NAME=${BASE_IMAGE_NAME:-ubuntu-fips} - - BASE_IMAGE_TAG=${BASE_IMAGE_TAG:-22.04} pull_policy: build From b2bf51c1d8630d3cc2f735043ebbc98625b2e7d6 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 17:30:38 -0500 Subject: [PATCH 24/36] simplify buildspecs --- buildspec/merge_master.yaml | 7 +++---- buildspec/push.yaml | 7 +++---- buildspec/release.yaml | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/buildspec/merge_master.yaml b/buildspec/merge_master.yaml index 26f473ef..40ad90fd 100644 --- a/buildspec/merge_master.yaml +++ b/buildspec/merge_master.yaml @@ -4,13 +4,12 @@ phases: commands: - export DOCKER_BUILDKIT=1 - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" - - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" - build: - commands: - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} + build: + commands: - echo Building the Docker image... - - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} -t ${FIPS_REPOSITORY_URI}:latest . + - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} -t ${FIPS_REPOSITORY_URI}:latest . - docker image push --all-tags ${FIPS_REPOSITORY_URI} post_build: commands: diff --git a/buildspec/push.yaml b/buildspec/push.yaml index 873c8e82..9bb31fc4 100644 --- a/buildspec/push.yaml +++ b/buildspec/push.yaml @@ -4,16 +4,15 @@ phases: commands: - export DOCKER_BUILDKIT=1 - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" - - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" - build: - commands: - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} + build: + commands: - export COMMIT_HASH_SHORT="$(echo $COMMIT_HASH | cut -c 1-7)" - echo Building the Docker image... - echo $COMMIT_HASH_SHORT - echo $BRANCH_NAME - - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME} . + - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME} . - docker image push --all-tags ${FIPS_REPOSITORY_URI} post_build: commands: diff --git a/buildspec/release.yaml b/buildspec/release.yaml index 7b31da19..5addc92f 100644 --- a/buildspec/release.yaml +++ b/buildspec/release.yaml @@ -5,15 +5,14 @@ phases: commands: - export DOCKER_BUILDKIT=1 - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" - - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)" - build: - commands: - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} + build: + commands: - PATCH_TAG=${TAG_NAME#"v"} - MINOR_TAG=${PATCH_TAG%.*} - MAJOR_TAG=${MINOR_TAG%.*} - - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} -t ${FIPS_REPOSITORY_URI}:${PATCH_TAG} -t ${FIPS_REPOSITORY_URI}:${MINOR_TAG} -t ${FIPS_REPOSITORY_URI}:${MAJOR_TAG} . + - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} -t ${FIPS_REPOSITORY_URI}:${PATCH_TAG} -t ${FIPS_REPOSITORY_URI}:${MINOR_TAG} -t ${FIPS_REPOSITORY_URI}:${MAJOR_TAG} . - docker image push --all-tags ${FIPS_REPOSITORY_URI} post_build: commands: From a7fa813cd243219d107af97550c7da9a8ba99d16 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 17:49:55 -0500 Subject: [PATCH 25/36] styling --- buildspec/merge_master.yaml | 7 ++++++- buildspec/push.yaml | 10 ++++++++-- buildspec/release.yaml | 12 ++++++++++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/buildspec/merge_master.yaml b/buildspec/merge_master.yaml index 40ad90fd..5213d2dd 100644 --- a/buildspec/merge_master.yaml +++ b/buildspec/merge_master.yaml @@ -9,7 +9,12 @@ phases: build: commands: - echo Building the Docker image... - - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} -t ${FIPS_REPOSITORY_URI}:latest . + - > + docker build + --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} + --tag ${FIPS_REPOSITORY_URI}:latest + . + - docker image push --all-tags ${FIPS_REPOSITORY_URI} post_build: commands: diff --git a/buildspec/push.yaml b/buildspec/push.yaml index 9bb31fc4..c9809b0e 100644 --- a/buildspec/push.yaml +++ b/buildspec/push.yaml @@ -4,15 +4,21 @@ phases: commands: - export DOCKER_BUILDKIT=1 - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)" + - export COMMIT_HASH_SHORT="$(echo $COMMIT_HASH | cut -c 1-7)" - echo Logging in to Amazon ECR... - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} build: commands: - - export COMMIT_HASH_SHORT="$(echo $COMMIT_HASH | cut -c 1-7)" + - > - echo Building the Docker image... - echo $COMMIT_HASH_SHORT - echo $BRANCH_NAME - - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME} . + docker build + --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} + --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} + --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME} + . + - docker image push --all-tags ${FIPS_REPOSITORY_URI} post_build: commands: diff --git a/buildspec/release.yaml b/buildspec/release.yaml index 5addc92f..8fb27830 100644 --- a/buildspec/release.yaml +++ b/buildspec/release.yaml @@ -1,4 +1,3 @@ - version: 0.2 phases: pre_build: @@ -12,7 +11,16 @@ phases: - PATCH_TAG=${TAG_NAME#"v"} - MINOR_TAG=${PATCH_TAG%.*} - MAJOR_TAG=${MINOR_TAG%.*} - - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} -t ${FIPS_REPOSITORY_URI}:${PATCH_TAG} -t ${FIPS_REPOSITORY_URI}:${MINOR_TAG} -t ${FIPS_REPOSITORY_URI}:${MAJOR_TAG} . + + - echo Building the Docker image... + - > + docker build + --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} + --tag ${FIPS_REPOSITORY_URI}:${PATCH_TAG} + --tag ${FIPS_REPOSITORY_URI}:${MINOR_TAG + --tag ${FIPS_REPOSITORY_URI}:${MAJOR_TAG} + . + - docker image push --all-tags ${FIPS_REPOSITORY_URI} post_build: commands: From 0733b589fa6fcfc26a089771f49529fab89eadd9 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 18:04:42 -0500 Subject: [PATCH 26/36] remove .env.example --- .env.example | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .env.example diff --git a/.env.example b/.env.example deleted file mode 100644 index a44f335f..00000000 --- a/.env.example +++ /dev/null @@ -1,5 +0,0 @@ -# ECR Configuration for FIPS Base Image -ECR_ACCOUNT_ID=0123456789012 -ECR_REGION=us-east-999 -BASE_IMAGE_NAME=ubuntu-fips -BASE_IMAGE_TAG=22.04 From 3682f49056466d312c57fcb99b4ca88b2499cb0f Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 18:08:19 -0500 Subject: [PATCH 27/36] move build policy up --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1612a71c..ac5738a2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,7 @@ services: docker-linuxserver-ubuntu-fips: image: ${ECR_ACCOUNT_ID:-123456789012}.dkr.ecr-fips.us-east-1.amazonaws.com/docker-linuxserver-ubuntu-fips:${IMAGE_TAG:-local} + pull_policy: build build: context: . dockerfile: Dockerfile @@ -18,4 +19,3 @@ services: - REL=${REL:-jammy} - ARCH=${ARCH:-amd64} - ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} - pull_policy: build From 70f1c94cb0cfbb54bbf6f3f6e8ae8d2468c52fb8 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 18:13:23 -0500 Subject: [PATCH 28/36] save --- Dockerfile | 2 ++ docker-compose.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 09697b30..e0794849 100644 --- a/Dockerfile +++ b/Dockerfile @@ -125,6 +125,7 @@ RUN \ /app \ /config \ /defaults \ + /lsiopy \ /workspace && \ echo "**** cleanup ****" && \ apt-get autoremove && \ @@ -135,6 +136,7 @@ RUN \ /var/tmp/* \ /var/log/* +# add local files COPY root/ / ENTRYPOINT ["/init"] diff --git a/docker-compose.yml b/docker-compose.yml index ac5738a2..8f8c492e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: platforms: - linux/amd64 args: + - BUILD_DATE=${BUILD_DATE:-2025-01-21T00:00:00Z} - VERSION=${VERSION:-jammy-22.04} - S6_OVERLAY_VERSION=${S6_OVERLAY_VERSION:-3.1.6.2} - S6_OVERLAY_ARCH=${S6_OVERLAY_ARCH:-x86_64} From 8f9669a733278c1a39c5e29fa6a6a8de5a5e73ae Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 18:14:09 -0500 Subject: [PATCH 29/36] /config --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e0794849..91a6fd07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,7 +60,7 @@ FROM ubuntu-fips-s6 as linuxserver-base # set environment variables ARG DEBIAN_FRONTEND="noninteractive" -ENV HOME="/workspace" \ +ENV HOME="/config" \ LANGUAGE="en_US.UTF-8" \ LANG="en_US.UTF-8" \ TERM="xterm" \ @@ -119,7 +119,7 @@ RUN \ echo "**** generate locale ****" && \ locale-gen en_US.UTF-8 && \ echo "**** create abc user and make our folders ****" && \ - useradd -u 911 -U -d /workspace -s /bin/false abc && \ + useradd -u 911 -U -d /config -s /bin/false abc && \ usermod -G users abc && \ mkdir -p \ /app \ From b69e351a47aa5eb272e56f3abf832ca93ba65f67 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 18:14:32 -0500 Subject: [PATCH 30/36] /root --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 91a6fd07..4258a837 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,7 +60,7 @@ FROM ubuntu-fips-s6 as linuxserver-base # set environment variables ARG DEBIAN_FRONTEND="noninteractive" -ENV HOME="/config" \ +ENV HOME="/root" \ LANGUAGE="en_US.UTF-8" \ LANG="en_US.UTF-8" \ TERM="xterm" \ From 6944ec64d1aa57a2a4aaad04f373e15301414802 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 18:21:58 -0500 Subject: [PATCH 31/36] simplify Dockerfile --- Dockerfile | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4258a837..bd61492d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,21 +8,13 @@ ARG BASE_IMAGE_TAG=22.04 ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} FROM ${ECR_URI} as ubuntu-fips-s6 -# set version labels -ARG BUILD_DATE -ARG VERSION -ARG MODS_VERSION="v3" -ARG PKG_INST_VERSION="v1" -ARG LSIOWN_VERSION="v1" -ARG S6_OVERLAY_VERSION="3.1.6.2" -ARG S6_OVERLAY_ARCH="x86_64" - -LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="civisanalytics" ENV REL=jammy ENV ARCH=amd64 +ARG S6_OVERLAY_VERSION="3.1.6.2" +ARG S6_OVERLAY_ARCH="x86_64" + # Install base development tools (no Python) RUN apt-get update && apt-get install -y \ curl \ @@ -37,7 +29,7 @@ RUN apt-get update && apt-get install -y \ # Clean up rm -rf /var/lib/apt/lists/* && \ # Update CA certificates to ensure SSL/TLS works properly - update-ca-certificates + update-ca-certificates # add s6 overlay ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp @@ -51,13 +43,21 @@ RUN tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz /tmp RUN tar -C / -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz -# add mods +FROM ubuntu-fips-s6 as linuxserver-base + +ARG BUILD_DATE +ARG VERSION +ARG MODS_VERSION="v3" +ARG PKG_INST_VERSION="v1" +ARG LSIOWN_VERSION="v1" + +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="civisanalytics" + ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods" ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run" ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown" -FROM ubuntu-fips-s6 as linuxserver-base - # set environment variables ARG DEBIAN_FRONTEND="noninteractive" ENV HOME="/root" \ @@ -66,7 +66,9 @@ ENV HOME="/root" \ TERM="xterm" \ S6_CMD_WAIT_FOR_SERVICES_MAXTIME="0" \ S6_VERBOSITY=1 \ - S6_STAGE2_HOOK=/docker-mods + S6_STAGE2_HOOK=/docker-mods \ + VIRTUAL_ENV=/lsiopy \ + PATH="/lsiopy/bin:$PATH" RUN \ echo "**** Ripped from Ubuntu Docker Logic ****" && \ From 78eac98faaf32f1e21187883dd2f4dc92c8ac01a Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 18:45:27 -0500 Subject: [PATCH 32/36] update placeholders --- Dockerfile | 2 +- docker-compose.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index bd61492d..e4d4807e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 # ECR and base image configuration - extracted from CodeBuild environment -ARG ECR_ACCOUNT_ID=0123456789012 +ARG ECR_ACCOUNT_ID ARG ECR_REGION=us-east-1 ARG BASE_IMAGE_NAME=civis-ubuntu-fips ARG BASE_IMAGE_TAG=22.04 diff --git a/docker-compose.yml b/docker-compose.yml index 8f8c492e..da61eab1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ --- services: docker-linuxserver-ubuntu-fips: - image: ${ECR_ACCOUNT_ID:-123456789012}.dkr.ecr-fips.us-east-1.amazonaws.com/docker-linuxserver-ubuntu-fips:${IMAGE_TAG:-local} + image: ${ECR_ACCOUNT_ID:-0123456789012}.dkr.ecr-fips.us-east-1.amazonaws.com/docker-linuxserver-ubuntu-fips:${IMAGE_TAG:-local} pull_policy: build build: context: . @@ -10,7 +10,7 @@ services: platforms: - linux/amd64 args: - - BUILD_DATE=${BUILD_DATE:-2025-01-21T00:00:00Z} + - BUILD_DATE=${BUILD_DATE:-2025-07-01T00:00:00Z} - VERSION=${VERSION:-jammy-22.04} - S6_OVERLAY_VERSION=${S6_OVERLAY_VERSION:-3.1.6.2} - S6_OVERLAY_ARCH=${S6_OVERLAY_ARCH:-x86_64} @@ -19,4 +19,4 @@ services: - LSIOWN_VERSION=${LSIOWN_VERSION:-v1} - REL=${REL:-jammy} - ARCH=${ARCH:-amd64} - - ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} + - ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID:-0123456789012} From 7a5b5786e2fbbcf44dde0c614f3227cba4e1ed28 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 19:21:50 -0500 Subject: [PATCH 33/36] latest --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index da61eab1..e7ea2f9a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ --- services: docker-linuxserver-ubuntu-fips: - image: ${ECR_ACCOUNT_ID:-0123456789012}.dkr.ecr-fips.us-east-1.amazonaws.com/docker-linuxserver-ubuntu-fips:${IMAGE_TAG:-local} + image: ${ECR_ACCOUNT_ID:-0123456789012}.dkr.ecr-fips.us-east-1.amazonaws.com/docker-linuxserver-ubuntu-fips:latest pull_policy: build build: context: . From 027f18fd911e82ddb5f5534c37fd5f9345c4d118 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Thu, 24 Jul 2025 20:02:56 -0500 Subject: [PATCH 34/36] fixed buildspec yamls --- buildspec/push.yaml | 3 +-- buildspec/release.yaml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/buildspec/push.yaml b/buildspec/push.yaml index c9809b0e..981878a5 100644 --- a/buildspec/push.yaml +++ b/buildspec/push.yaml @@ -9,16 +9,15 @@ phases: - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI} build: commands: - - > - echo Building the Docker image... - echo $COMMIT_HASH_SHORT - echo $BRANCH_NAME + - > docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --tag ${FIPS_REPOSITORY_URI}:${COMMIT_HASH_SHORT} --tag ${FIPS_REPOSITORY_URI}:${BRANCH_NAME} . - - docker image push --all-tags ${FIPS_REPOSITORY_URI} post_build: commands: diff --git a/buildspec/release.yaml b/buildspec/release.yaml index 8fb27830..8f459c33 100644 --- a/buildspec/release.yaml +++ b/buildspec/release.yaml @@ -17,7 +17,7 @@ phases: docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --tag ${FIPS_REPOSITORY_URI}:${PATCH_TAG} - --tag ${FIPS_REPOSITORY_URI}:${MINOR_TAG + --tag ${FIPS_REPOSITORY_URI}:${MINOR_TAG} --tag ${FIPS_REPOSITORY_URI}:${MAJOR_TAG} . From 30e14a48da9d6f9ffae4bccee0db59c84b58a3bd Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Fri, 25 Jul 2025 11:51:30 -0500 Subject: [PATCH 35/36] disable chowning of /config --- root/etc/s6-overlay/s6-rc.d/init-adduser/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-adduser/run b/root/etc/s6-overlay/s6-rc.d/init-adduser/run index a03a3e92..3e955a52 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-adduser/run +++ b/root/etc/s6-overlay/s6-rc.d/init-adduser/run @@ -28,5 +28,5 @@ User GID: $(id -g abc) " lsiown abc:abc /app -lsiown abc:abc /config +# lsiown abc:abc /config lsiown abc:abc /defaults From 7e01fa7063cc04f283d1bdfd21c545dee221e916 Mon Sep 17 00:00:00 2001 From: Gabe Mendoza Date: Fri, 25 Jul 2025 12:00:52 -0500 Subject: [PATCH 36/36] fix pr template --- .github/PULL_REQUEST_TEMPLATE.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c1f5d9e2..f78f95a0 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,15 +1,3 @@ -ver_medium.png)][linuxserverurl] - -ut. We do not need a PR --> -ange for corner case functionality or plugins please look at making a Docker Mod or local script https://blog.linuxserver.io/2019/09/14/customizing-our-containers/ --> -message --> ---> -repository, please add your changes there if appropriate --> - -TRIBUTING.md) guideline and understand that I have made the correct modifications - -> - ## Description Required: Please provide a brief description of what this pull request is trying to accomplish.