Skip to content

Commit

Permalink
sle image (#131)
Browse files Browse the repository at this point in the history
* sle image

Signed-off-by: Prabhu Subramanian <[email protected]>

* sle image

Signed-off-by: Prabhu Subramanian <[email protected]>

* Added gcc, git, awk to sle image

Signed-off-by: Prabhu Subramanian <[email protected]>

---------

Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu authored Feb 20, 2024
1 parent 0d87b16 commit 4691a65
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,21 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=atom
cache-to: type=gha,mode=max,scope=atom

- name: Extract metadata (tags, labels) for Docker
id: meta2
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/appthreat/atom-sle
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
file: ci/Dockerfile.sle
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta2.outputs.tags }}
labels: ${{ steps.meta2.outputs.labels }}
cache-from: type=gha,scope=atom-sle
cache-to: type=gha,mode=max,scope=atom-sle
2 changes: 1 addition & 1 deletion ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/appthreat/base:al9
FROM ghcr.io/appthreat/base:main

LABEL maintainer="appthreat" \
org.opencontainers.image.authors="Team AppThreat <[email protected]>" \
Expand Down
64 changes: 64 additions & 0 deletions ci/Dockerfile.sle
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
FROM ghcr.io/appthreat/bci-lang:main

LABEL maintainer="appthreat" \
org.opencontainers.image.authors="Team AppThreat <[email protected]>" \
org.opencontainers.image.source="https://github.com/appthreat/atom" \
org.opencontainers.image.url="https://github.com/appthreat/atom" \
org.opencontainers.image.version="2.0.x" \
org.opencontainers.image.vendor="appthreat" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.title="atom" \
org.opencontainers.image.description="Container image for AppThreat atom" \
org.opencontainers.docker.cmd="docker run --rm -v /tmp:/tmp -v $HOME:$HOME -v $(pwd):/app:rw -it ghcr.io/appthreat/atom-sle -o /app/app.atom -l java /app"


ENV ANDROID_HOME=/opt/android-sdk-linux \
JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF-8" \
PHP_PARSER_BIN=/opt/vendor/bin/php-parse \
COMPOSER_ALLOW_SUPERUSER=1

ENV PATH=/opt/bin:/opt/vendor/bin:${PATH}:/usr/local/bin/:/root/.local/bin:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:

WORKDIR /opt

RUN set -e; \
ARCH_NAME="$(rpm --eval '%{_arch}')"; \
url=; \
case "${ARCH_NAME##*-}" in \
'x86_64') \
OS_ARCH_SUFFIX=''; \
;; \
'aarch64') \
OS_ARCH_SUFFIX='-aarch64'; \
;; \
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
esac; \
zypper --non-interactive install -l --no-recommends php8 php8-cli php8-curl php8-zip php8-bcmath php8-pear php8-mbstring php8-devel \
&& mkdir -p ${ANDROID_HOME}/cmdline-tools \
&& curl -L https://dl.google.com/android/repository/commandlinetools-linux-10406996_latest.zip -o ${ANDROID_HOME}/cmdline-tools/android_tools.zip \
&& unzip ${ANDROID_HOME}/cmdline-tools/android_tools.zip -d ${ANDROID_HOME}/cmdline-tools/ \
&& rm ${ANDROID_HOME}/cmdline-tools/android_tools.zip \
&& mv ${ANDROID_HOME}/cmdline-tools/cmdline-tools ${ANDROID_HOME}/cmdline-tools/latest \
&& yes | /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --licenses --sdk_root=/opt/android-sdk-linux \
&& /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager 'platform-tools' --sdk_root=/opt/android-sdk-linux \
&& /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager 'platforms;android-34' --sdk_root=/opt/android-sdk-linux \
&& /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager 'build-tools;34.0.0' --sdk_root=/opt/android-sdk-linux \
&& npm install -g @cyclonedx/cdxgen --omit=optional \
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php \
&& mv composer.phar /usr/local/bin/composer \
&& curl -LO https://raw.githubusercontent.com/AppThreat/chen/main/platform/frontends/php2atom/composer.lock \
&& curl -LO https://raw.githubusercontent.com/AppThreat/chen/main/platform/frontends/php2atom/composer.json

COPY ./target/atom.zip .
COPY ./wrapper .
RUN unzip -q atom.zip \
&& composer update --no-progress --prefer-dist --ignore-platform-reqs \
&& cd /opt/nodejs && npm install --only=production && cd /opt \
&& npm install -g /opt/nodejs \
&& rm -rf atom.zip composer.json composer.lock composer-setup.php /usr/local/bin/atom \
&& /opt/bin/atom --help \
&& which astgen \
&& which phpastgen \
&& zypper clean -a

ENTRYPOINT ["/opt/bin/atom"]

0 comments on commit 4691a65

Please sign in to comment.