Skip to content

Commit

Permalink
Set and verify OpenSSL paths as environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Jan 15, 2025
1 parent f2e636f commit 29574cd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
- name: Verify 'rustfmt'
run: rustfmt --version
shell: bash
- name: Verify 'openssl'
run: openssl version
shell: bash
- name: Verify 'go'
run: go version
shell: bash
Expand All @@ -41,3 +44,12 @@ jobs:
- name: Verify 'npm'
run: npm --version
shell: bash
- name: Verify 'OPENSSL_LIB_DIR'
run: echo "$OPENSSL_LIB_DIR"
shell: bash
- name: Verify 'OPENSSL_INCLUDE_DIR'
run: echo "$OPENSSL_INCLUDE_DIR"
shell: bash
- name: Verify 'OPENSSL_STATIC'
run: echo "$OPENSSL_STATIC"
shell: bash
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RUN apt-get install -y --no-install-recommends \
vim \
git \
jq \
findutils \
build-essential \
libssl-dev \
libffi-dev \
Expand All @@ -42,6 +43,21 @@ RUN ln -s /usr/bin/python3.10 /usr/bin/python
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 \

Check warning on line 57 in Dockerfile

View workflow job for this annotation

GitHub Actions / release

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$OPENSSL_LIB_DIR' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 57 in Dockerfile

View workflow job for this annotation

GitHub Actions / release

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$OPENSSL_INCLUDE_DIR' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
OPENSSL_INCLUDE_DIR=$OPENSSL_INCLUDE_DIR \
OPENSSL_STATIC=1

# Download and unzip the github actions runner
RUN mkdir actions-runner && cd actions-runner \
&& curl -O -L ${RELEASE_URL}/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
Expand Down

0 comments on commit 29574cd

Please sign in to comment.