-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 76a785f
Showing
6 changed files
with
552 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: wagoautomation/sdk-builder | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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 @@ | ||
*.crt |
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,100 @@ | ||
ARG REGISTRY_PREFIX='' | ||
ARG CODENAME='focal' | ||
|
||
|
||
|
||
FROM ${REGISTRY_PREFIX}ubuntu:${CODENAME} as builder | ||
COPY certs/* /usr/local/share/ca-certificates/ | ||
RUN apt update \ | ||
&& DEBIAN_FRONTEND=noninteractive TZ="Europe/Berlin" apt install -y --no-install-recommends \ | ||
build-essential \ | ||
curl \ | ||
libncurses5-dev \ | ||
wget \ | ||
gawk \ | ||
flex \ | ||
bison \ | ||
texinfo \ | ||
python-dev \ | ||
python3-setuptools \ | ||
g++ \ | ||
dialog \ | ||
lzop \ | ||
libc6-dev \ | ||
autoconf \ | ||
libtool \ | ||
xmlstarlet \ | ||
xsltproc \ | ||
doxygen \ | ||
autopoint \ | ||
gettext \ | ||
rsync \ | ||
vim \ | ||
software-properties-common \ | ||
bc \ | ||
groff \ | ||
zip \ | ||
unzip \ | ||
pkg-config | ||
|
||
FROM builder as dumb_init | ||
ARG BUILD_DIR=/tmp/build | ||
ARG DUMB_INIT_VERSION=1.2.5 | ||
RUN mkdir -p "${BUILD_DIR}" \ | ||
&& cd "${BUILD_DIR}" \ | ||
&& curl -fSL -s -o dumb-init-${DUMB_INIT_VERSION}.tar.gz https://github.com/Yelp/dumb-init/archive/v${DUMB_INIT_VERSION}.tar.gz \ | ||
&& tar -xf dumb-init-${DUMB_INIT_VERSION}.tar.gz \ | ||
&& cd "dumb-init-${DUMB_INIT_VERSION}" \ | ||
&& make \ | ||
&& chmod +x dumb-init \ | ||
&& mv dumb-init /usr/local/bin/dumb-init \ | ||
&& dumb-init --version | ||
|
||
FROM builder as toolchain | ||
ARG TOOLCHAIN_DIR=/opt/gcc-Toolchain-2022.02 | ||
ARG TOOLCHAIN_URL=https://github.com/WAGO/gcc-toolchain/releases/download/gcc-toolchain-2022.02/gcc-linaro.toolchain-2022.02-arm-linux-gnueabihf.tar.gz | ||
RUN mkdir -p "${TOOLCHAIN_DIR}" \ | ||
&& curl -fSL -s -o gcc-linaro.toolchain-2022.02-arm-linux-gnueabihf.tar.gz "${TOOLCHAIN_URL}" \ | ||
&& tar -xf gcc-linaro.toolchain-2022.02-arm-linux-gnueabihf.tar.gz -C "${TOOLCHAIN_DIR}" \ | ||
&& rm -rf "${TOOLCHAIN_DIR}/.git" \ | ||
"${TOOLCHAIN_DIR}/arm-linux-gnueabihf/share/doc" \ | ||
"${TOOLCHAIN_DIR}/arm-linux-gnueabihf/libexec/gcc/arm-linux-gnueabihf/9.2.1/f951" \ | ||
"${TOOLCHAIN_DIR}/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gfortran" \ | ||
gcc-linaro.toolchain-2022.02-arm-linux-gnueabihf.tar.gz | ||
|
||
FROM builder as ptxdist | ||
ARG PTXDIST_URL=https://github.com/WAGO/ptxdist/archive/refs/tags/Update-2020.08.0.tar.gz | ||
RUN cd /tmp \ | ||
&& curl -fSL -s -o ptxdist.tar.xz "${PTXDIST_URL}" \ | ||
&& tar -xf ptxdist.tar.xz \ | ||
&& cd ptxdist-Update-2020.08.0 \ | ||
&& ./configure \ | ||
&& make | ||
|
||
FROM builder as image | ||
|
||
ARG TOOLCHAIN_DIR=/opt/gcc-Toolchain-2022.02 | ||
|
||
COPY --from=dumb_init /usr/local/bin/dumb-init /usr/local/bin/dumb-init | ||
COPY --from=toolchain "${TOOLCHAIN_DIR}" "${TOOLCHAIN_DIR}" | ||
|
||
COPY --from=ptxdist /tmp/ptxdist-Update-2020.08.0 /tmp/ptxdist-Update-2020.08.0 | ||
RUN cd /tmp/ptxdist-Update-2020.08.0 \ | ||
&& make install \ | ||
&& cd - \ | ||
&& rm -rf /tmp/ptxdist-Update-2020.08.0 | ||
|
||
RUN mkdir -p /home/user/ptxproj | ||
RUN rm /usr/local/share/ca-certificates/* | ||
|
||
FROM scratch | ||
|
||
LABEL maintainer="WAGO GmbH & Co. KG" | ||
LABEL version="1.0.0" | ||
LABEL description="SDK Builder" | ||
|
||
COPY --from=image / / | ||
|
||
WORKDIR "/home/user/ptxproj" | ||
|
||
ENTRYPOINT ["dumb-init", "--"] |
Oops, something went wrong.