Skip to content

Commit

Permalink
Add Docker image to build natives with older dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahgraham committed Feb 3, 2025
1 parent b330359 commit a6fa825
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions JenkinsJobs/Builds/DockerImagesBuild.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pipeline {
dir('eclipse.platform.releng.aggregator/cje-production/dockerfiles') {
parallel(
'debian-swtnative': { buildAndPushImage('debian/swtnativebuild', 'eclipse/platformreleng-debian-swtnativebuild:12') },
'debian-swtgtk3native': { buildAndPushImage('debian/swtgtk3nativebuild', 'eclipse/platformreleng-debian-swtgtk3nativebuild:10') },
'centos9-gtk4': { buildAndPushImage('centos-gtk4-mutter/9-gtk4', 'eclipse/platformreleng-centos-gtk4-mutter:9') },
'opensuse-gtk3': { buildAndPushImage('opensuse-gtk3-metacity/15-gtk3', 'eclipse/platformreleng-opensuse-gtk3-metacity:15') },
failFast: false)
Expand Down
44 changes: 44 additions & 0 deletions cje-production/dockerfiles/debian/swtgtk3nativebuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM debian:10

### user name recognition at runtime w/ an arbitrary uid - for OpenShift deployments
COPY scripts/uid_entrypoint /usr/local/bin/uid_entrypoint
RUN chmod u+x /usr/local/bin/uid_entrypoint && \
chgrp 0 /usr/local/bin/uid_entrypoint && \
chmod g=u /usr/local/bin/uid_entrypoint /etc/passwd
### end

ENV LANG=en_US.UTF-8
RUN apt-get update -qq && apt-get install -qq -y \
locales \
build-essential \
procps \
git \
libgtk-3-dev \
freeglut3-dev \
webkit2gtk-driver \
curl


# Use Java17 from JustJ because Debian 10 comes with JDK11 only
RUN mkdir -p /usr/lib/jvm/justj-17 && \
cd /usr/lib/jvm/justj-17 && \
curl "https://download.eclipse.org/justj/jres/17/downloads/20230428_1804/org.eclipse.justj.openjdk.hotspot.jre.minimal.stripped-17.0.7-linux-x86_64.tar.gz" | tar -xzf - include/ lib/

ENV HOME=/home/swtbuild
ENV DISPLAY :0
RUN useradd -u 10001 -d ${HOME} testuser

RUN mkdir -p /var/lib/dbus && dbus-uuidgen > /var/lib/dbus/machine-id \
&& mkdir -p /var/run/dbus

# Make $HOME open to the 'root' group (so Jenkins/OpenShift user can write there)
WORKDIR $HOME
RUN chgrp -R 0 ${HOME} && chmod -R g=u ${HOME}

RUN localedef -i en_US -f UTF-8 en_US.UTF-8
ENV LANG=en_US.UTF-8
# This is only a partial Java, the headers needed to compile natives
ENV SWT_JAVA_HOME=/usr/lib/jvm/justj-17
ENV JAVA_HOME=/usr/lib/jvm/justj-17

USER 10001
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh
if ! whoami > /dev/null 2>&1; then
if [ -w /etc/passwd ]; then
echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
fi
fi
exec "$@"

0 comments on commit a6fa825

Please sign in to comment.