-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Baseimage (#67) * baseimage build separated from regular build to save time * buildx push * fix build command * remove dependencies and switcht o baseimage
- Loading branch information
1 parent
72a7e68
commit b56adde
Showing
3 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} |