Add codeql to server container for standalone testing
For full test, we cannot have
ERROR codeql database analyze failed: error="exec:
\"codeql\": executable file not found in $PATH" job="{MirvaRequestID:0
QueryPackId:54674 QueryLanguage:cpp ORepo:{Owner:psycopg Repo:psycopg2}}"
For linux/arm64, use a Dockerfile that:
- uses ubuntu 22.04 base image
- adds the 1.17 version of the codeql bundle
- extracts the bundle
- adds a recent version of the JRE
- extracts it
- sets the CODEQL_JAVA_HOME environment variable to point to the JRE
The instructions are updated
This commit is contained in:
committed by
=Michael Hohn
parent
765a76f75a
commit
5730c330f4
@@ -1,14 +1,38 @@
|
||||
# Use Ubuntu 22.04 as the base image
|
||||
FROM arm64v8/ubuntu:22.04
|
||||
# Use the ubuntu 22.04 base image
|
||||
FROM ubuntu:22.04
|
||||
|
||||
# Set environment variables to non-interactive to avoid prompts during installation
|
||||
# Set architecture to arm64
|
||||
ARG ARCH=arm64
|
||||
ARG AARCH=aarch64
|
||||
|
||||
# Set environment variables
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV CODEQL_VERSION=codeql-bundle-v2.17.5
|
||||
ENV CODEQL_DOWNLOAD_URL=https://github.com/github/codeql-action/releases/download/${CODEQL_VERSION}/codeql-bundle-linux64.tar.gz
|
||||
ENV JDK_VERSION=22.0.1
|
||||
ENV JDK_DOWNLOAD_URL=https://download.oracle.com/java/21/latest/jdk-${JDK_VERSION}_linux-${AARCH}_bin.tar.gz
|
||||
ENV JDK_DOWNLOAD_URL=https://download.java.net/java/GA/jdk${JDK_VERSION}/c7ec1332f7bb44aeba2eb341ae18aca4/8/GPL/openjdk-${JDK_VERSION}_linux-${AARCH}_bin.tar.gz
|
||||
|
||||
# Update the package list
|
||||
ENV CODEQL_JAVA_HOME=/usr/local/jdk-${JDK_VERSION}
|
||||
|
||||
# Install necessary tools
|
||||
RUN apt-get update && \
|
||||
apt-get clean
|
||||
apt-get install -y curl tar && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Add and extract the CodeQL bundle
|
||||
RUN curl -L $CODEQL_DOWNLOAD_URL -o /tmp/${CODEQL_VERSION}.tar.gz && \
|
||||
tar -xzf /tmp/${CODEQL_VERSION}.tar.gz -C /opt && \
|
||||
rm /tmp/${CODEQL_VERSION}.tar.gz
|
||||
|
||||
# Add and extract the JDK
|
||||
RUN curl -L $JDK_DOWNLOAD_URL -o /tmp/jdk-${JDK_VERSION}.tar.gz && \
|
||||
tar -xzf /tmp/jdk-${JDK_VERSION}.tar.gz -C /usr/local && \
|
||||
rm /tmp/jdk-${JDK_VERSION}.tar.gz
|
||||
|
||||
# Set PATH
|
||||
ENV PATH=/opt/codeql:"$PATH"
|
||||
|
||||
# Prepare host mount point
|
||||
RUN mkdir /mrva
|
||||
|
||||
# Set the default command
|
||||
CMD ["bash"]
|
||||
|
||||
Reference in New Issue
Block a user