Browse Source

Initial commit

tags/0.1.0
Zopanix 4 years ago
commit
2378eb8759
6 changed files with 124 additions and 0 deletions
  1. +25
    -0
      Dockerfile
  2. +67
    -0
      Jenkinsfile
  3. +17
    -0
      README.md
  4. +6
    -0
      hooks/build
  5. +5
    -0
      resources/build
  6. +4
    -0
      resources/fxinnovation.cnf

+ 25
- 0
Dockerfile View File

@@ -0,0 +1,25 @@
FROM mysql:5.7.18

ARG BUILD_DATE
ARG VCS_REF
ARG VERSION

ADD ./resources /resources

RUN /resources/build && rm -rf resources

LABEL "maintainer"="cloudsquad@fxinnovation.com" \
"org.label-schema.name"="mysql" \
"org.label-schema.base-image.name"="docker.io/library/mysql" \
"org.label-schema.base-image.version"="5.7.18" \
"org.label-schema.description"="MySQL in a container" \
"org.label-schema.url"="https://www.mysql.com" \
"org.label-schema.vcs-url"="https://bitbucket.org/fxadmin/public-common-docker-mysql" \
"org.label-schema.vendor"="FXinnovation" \
"org.label-schema.schema-version"="1.0.0-rc.1" \
"org.label-schema.applications.mysql.version"=$MYSQL_VERSION \
"org.label-schema.applications.gosu.version"=$GOSU_VERSION \
"org.label-schema.vcs-ref"=$VCS_REF \
"org.label-schema.version"=$VERSION \
"org.label-schema.build-date"=$BUILD_DATE \
"org.label-schema.usage"="Should only be used on k8s. Check README.md for details why."

+ 67
- 0
Jenkinsfile View File

@@ -0,0 +1,67 @@
node {
result="SUCCESS"
color="GREEN"
notify=false
message="No special message"
try {
dockerhub_repo = 'fxinnovation/mysql'
ansiColor('xterm') {
stage('checkout') {
// Checking out scm
checkout scm
// Getting current commit sha1
commit_id = sh(
returnStdout: true,
script: "git rev-parse HEAD"
).trim()
// Getting current tag or commit sha1
tag_id = sh(
returnStdout: true,
script: "git describe --tags --exact-match || git rev-parse HEAD"
).trim()
// Getting scm url
scm_url = sh(
returnStdout: true,
script: "git config --get remote.origin.url"
).trim()
}
stage('pre-build') {
// Verifying docker is up and running
sh 'docker --version && docker images'
}
stage("build") {
// Building Docker Image
sh "docker build \
--build-arg \"VCS_REF\"=\"${commit_id}\" \
--build-arg \"VERSION\"=\"${tag_id}\" \
--build-arg \"BUILD_DATE\"=\"\$(date -u +\"%Y-%m-%dT%H:%M:%SZ\")\" \
-t ${dockerhub_repo}:${tag_id} ."
}
stage("test") {
sh "docker inspect ${dockerhub_repo}:${tag_id}"
message = "Docker build was succesfull"
}
}
}catch (error){
result="FAILED"
color="RED"
notify=true
message=error
throw (error)
}finally {
stage("notify"){
hipchatSend (
color: color,
credentialId: 'jenkins-hipchat-token',
message: "Job Name: ${JOB_NAME} (<a href=\"${BUILD_URL}\">Open</a>)<br /> \
Job Status: ${result} <br /> \
Job Message: <br /><pre>${message}</pre>",
room: '942680',
notify: notify,
sendAs: 'New-Jenkins',
server: 'api.hipchat.com',
v2enabled: false
)
}
}
}

+ 17
- 0
README.md View File

@@ -0,0 +1,17 @@
# MySQL
[![](https://images.microbadger.com/badges/version/fxinnovation/mysql.svg)](https://microbadger.com/images/fxinnovation/mysql "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/image/fxinnovation/mysql.svg)](https://microbadger.com/images/fxinnovation/mysql "Get your own image badge on microbadger.com")
## Description
This image contains mysql. The image is based on the official mysql image.

## Tags
We do NOT push a `latest` tag for this image. You should always pin a specific version for it.
We do not follow the mysql release tags in the docker image tags. You can always find the mysql version in the Dockerfile that was used to create the image or you can use the labels.

## Usage
This image was edited to be able to use `Persistent Volume Claims` on kubernetes. If you're not planning to use this image in a kubernetes cluster, you should use the official mysql image on which this is based.

## Labels
We set labels on our images with additional information on the image. we follow the guidelines defined at http://label-schema.org/. Visit their website for more information about those labels.

## Comments & Issues
If you have comments or detect an issue, please be advised we don't check the docker hub comments. You can always contact us through the repository.

+ 6
- 0
hooks/build View File

@@ -0,0 +1,6 @@
#!/bin/bash
docker build \
--build-arg VCS_REF=`git rev-parse HEAD` \
--build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` \
--build-arg VERSION=`git describe --tags --exact-match || git rev-parse HEAD` \
-t $IMAGE_NAME .

+ 5
- 0
resources/build View File

@@ -0,0 +1,5 @@
#!/bin/bash
set -e -x

# Adding fxinnovation config file for mysql
mv /resources/fxinnovation.cnf /etc/mysql/conf.d/fxinnovation.cnf

+ 4
- 0
resources/fxinnovation.cnf View File

@@ -0,0 +1,4 @@
# Adding this line will prevent error if you mount a folder in the container that conains lost+found
# More info: http://www.chriscalender.com/ignoring-the-lostfound-directory-in-your-datadir/
[mysqld]
ignore-db-dir=lost+found

Loading…
Cancel
Save