Explorar o código

Merge branch 'develop'

* develop:
  add php pdo modules
  add jenkinsfile
  add gnu tar and composer
ksieren %!s(int64=3) %!d(string=hai) anos
pai
achega
eb6c224787
Modificáronse 3 ficheiros con 51 adicións e 1 borrados
  1. 6 0
      Dockerfile
  2. 44 0
      Jenkinsfile
  3. 1 1
      README.md

+ 6 - 0
Dockerfile

@@ -32,9 +32,13 @@ RUN apk --no-cache add \
         php81-mbstring \
         php81-gd \
         php81-mongodb \
+        php81-pdo_mysql \
+        php81-pdo_pgsql \
+        php81-pdo_sqlite \
         nginx \
         runit \
         curl \
+        tar \
 # Bring in gettext so we can get `envsubst`, then throw
 # the rest away. To do this, we need to install `gettext`
 # then move `envsubst` out of the way so `gettext` can
@@ -60,6 +64,8 @@ RUN apk --no-cache add \
     && chown -R nobody.nobody /var/lib/nginx \
     && chown -R nobody.nobody /var/log/nginx
 
+RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
+
 # Add configuration files
 COPY --chown=nobody rootfs/ /
 

+ 44 - 0
Jenkinsfile

@@ -0,0 +1,44 @@
+def normalizedBranchName = "${BRANCH_NAME}".replaceAll('/','-').replaceAll('%2F','-').replaceAll('_','-').toLowerCase()
+def imageTag = "${normalizedBranchName}-${env.BUILD_ID}"
+def imageBuildId = "${env.BUILD_ID}"
+def dockerDeployWriteRegistry = "https://index.docker.io/v1/"
+
+podTemplate(yaml: """
+apiVersion: v1
+kind: Pod
+spec:
+  containers:
+  - name: docker
+    image: docker:1.11
+    command: ['cat']
+    tty: true
+    volumeMounts:
+    - name: dockersock
+      mountPath: /var/run/docker.sock
+  volumes:
+  - name: dockersock
+    hostPath:
+      path: /var/run/docker.sock
+"""
+  ) {
+
+  node(POD_LABEL) {
+    stage('Build Docker image') {
+      sh "git config --global http.sslverify false"
+      sh "export GIT_SSL_NO_VERIFY=true"
+      checkout scm
+      container('docker') {
+          docker.withRegistry("${dockerDeployWriteRegistry}", "deploy-docker-id") {
+              def imageNameWithTag = "kerstinsieren/alpine-phpfpm-nginx-baseimage:${imageTag}";
+              def imageNameTagLatest = "kerstinsieren/alpine-phpfpm-nginx-baseimage:${normalizedBranchName}-latest";
+              sh "docker build --no-cache -t ${imageNameWithTag} ."
+              sh "docker tag ${imageNameWithTag} ${imageNameTagLatest}"
+              def image = docker.image(imageNameWithTag)
+              image.push()
+              def imageLatest = docker.image(imageNameTagLatest)
+              imageLatest.push()
+          }
+      }
+    }
+  }
+}

+ 1 - 1
README.md

@@ -7,7 +7,7 @@ The image is only +/- 25MB large.
 Repository: https://git2.meramo.org/Infrastructure/alpine-phpfpm-nginx-baseimage.git
 
 * Built on the lightweight and secure Alpine Linux distribution
-* Very small Docker image size (+/-25MB)
+* Very small Docker image size (+/-65MB)
 * Uses PHP 8.1 for better performance, lower cpu usage & memory footprint
 * Multi-arch support: 386, amd64, arm/v6, arm/v7, arm64, ppc64le, s390x
 * Optimized for 100 concurrent users