Skip to content

Commit

Permalink
Move openssl env vars to shell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Jan 15, 2025
1 parent 29574cd commit f093964
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
16 changes: 1 addition & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,7 @@ RUN ln -s /usr/bin/python3.10 /usr/bin/python
# https://github.com/rust-lang/rustup/issues/297#issuecomment-444818896
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="${HOME}/.cargo/bin:${PATH}"

# Find OpenSSL paths, set environment variables, and persist them
RUN OPENSSL_LIB_PATH=$(find / -name 'libssl.so*' 2>/dev/null | head -n 1) && \
OPENSSL_LIB_DIR=$(dirname "$OPENSSL_LIB_PATH") && \
OPENSSL_INCLUDE_PATH=$(find /usr -name 'ssl.h' 2>/dev/null | grep -v '/node/' | head -n 1) && \
OPENSSL_INCLUDE_DIR=$(dirname "$OPENSSL_INCLUDE_PATH") && \
echo "OPENSSL_LIB_DIR=$OPENSSL_LIB_DIR" && \
echo "OPENSSL_INCLUDE_DIR=$OPENSSL_INCLUDE_DIR" && \
echo "OPENSSL_STATIC=$OPENSSL_STATIC" && \
export OPENSSL_LIB_DIR OPENSSL_INCLUDE_DIR

# Set the environment variables for future stages (persistent across containers)
ENV OPENSSL_LIB_DIR=$OPENSSL_LIB_DIR \
OPENSSL_INCLUDE_DIR=$OPENSSL_INCLUDE_DIR \
OPENSSL_STATIC=1
ENV OPENSSL_STATIC=1

# Download and unzip the github actions runner
RUN mkdir actions-runner && cd actions-runner \
Expand Down
7 changes: 7 additions & 0 deletions scripts/openssl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
OPENSSL_LIB_PATH=$(find / -name 'libssl.so*' 2>/dev/null | head -n 1)
OPENSSL_LIB_DIR=$(dirname "$OPENSSL_LIB_PATH")
OPENSSL_INCLUDE_PATH=$(find /usr -name 'ssl.h' 2>/dev/null | grep -v '/node/' | head -n 1)
OPENSSL_INCLUDE_DIR=$(dirname "$OPENSSL_INCLUDE_PATH")
export OPENSSL_STATIC=1
export OPENSSL_LIB_DIR="$OPENSSL_LIB_DIR"
export OPENSSL_INCLUDE_DIR="$OPENSSL_INCLUDE_DIR"
1 change: 1 addition & 0 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ source "${current_dir}/detector.sh"
source "${current_dir}/config.sh"
source "${current_dir}/notify.sh"
source "${current_dir}/squire.sh"
source "${current_dir}/openssl.sh"

# Env vars (docker-compose.yml)
RUNNER_NAME="${RUNNER_NAME:-"$(instance_id)"}"
Expand Down

0 comments on commit f093964

Please sign in to comment.