Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baseimage #67

Merged
merged 4 commits into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
FROM python:3.10-alpine
FROM rbrandstaedter/solarflow-control-baseimage:latest

# Create stdconfig directory
WORKDIR /

COPY solarflow-control.py /

# dependencies needed for ARMv6/7 builds
RUN pip install --upgrade pip && \
apk add libxml2-dev libxslt-dev libffi libffi-dev gcc musl-dev rust cargo openssl-dev && \
pip install paho-mqtt astral ip2geotools && \
apk del openssl-dev libffi-dev xz-dev libxml2-dev libxslt-dev openssl-dev linux-headers musl-dev gcc rust cargo && \
rm -rf /root/.cache/ && \
rm -rf /var/cache/apk/*

ENTRYPOINT ["python","solarflow-control.py"]
14 changes: 14 additions & 0 deletions src/Dockerfile-baseimage
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.10-alpine

# Create stdconfig directory
WORKDIR /

# dependencies needed for ARMv6/7 builds
RUN pip install --upgrade pip && \
apk add libxml2-dev libxslt-dev libffi libffi-dev gcc musl-dev rust cargo openssl-dev && \
pip install paho-mqtt astral ip2geotools && \
apk del openssl-dev libffi-dev xz-dev libxml2-dev libxslt-dev openssl-dev linux-headers musl-dev gcc rust cargo && \
rm -rf /root/.cache/ && \
rm -rf /var/cache/apk/*

ENTRYPOINT ["python"]
35 changes: 35 additions & 0 deletions src/Jenkinsfile-baseimage
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
pipeline {
agent { label 'docker-builder' }

environment {
DOCKER_HOST = "tcp://docker.local:2375"
DOCKER_REGISTRY = "rbrandstaedter"
LOG_LEVEL = "INFO"
BUILD_NUMBER = "${BUILD_NUMBER}"
TAG = "0.${BUILD_NUMBER}"
DOCKERHUB_LOGIN = credentials('docker-login-private')
GITHUB_AUTH_TOKEN = credentials('github_auth_token')
git_branch = "${GIT_BRANCH}"
BRANCH_NAME = git_branch.substring(git_branch.lastIndexOf('/') + 1, git_branch.length())
}

stages {
stage('Build Docker Base Images') {
steps {
sh 'printenv'
dir("${env.WORKSPACE}/src"){
sh label: 'Set up X-Builder', script: 'docker buildx rm crossbuilder && docker buildx create --name crossbuilder --platform linux/amd64,linux/arm/v6 && docker buildx ls && docker buildx use crossbuilder && docker buildx inspect --bootstrap'
sh label: 'Build Base Image', script: 'docker -H ${DOCKER_HOST} buildx build --push --platform linux/amd64,linux/arm/v6 -t ${DOCKER_REGISTRY}/solarflow-control-baseimage:latest -f Dockerfile-baseimage .'
}
}
}
}
post {
always {
cleanWs(cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true)
}
}
}