Skip to content

Commit

Permalink
Lint dockerfiles (#902)
Browse files Browse the repository at this point in the history
Co-authored-by: Roberto Pastor Muela <[email protected]>
  • Loading branch information
SMoraisAnsys and RobPasMue committed Feb 16, 2024
1 parent b9a3f9f commit 0a920df
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ jobs:
operating-system: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}

docker-style:
name: Docker Style Check
runs-on: ubuntu-latest
steps:
- name: PyAnsys documentation style checks
uses: ansys/actions/docker-style@v5
with:
directory: docker
recursive: true

# =================================================================================================
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# =================================================================================================
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
* [Maxime Rey](https://github.com/MaxJPRey)
* [Revathy Venugopal](https://github.com/Revathyvenugopal162)
* [Riccardo Manno](https://github.com/rmanno91)
* [Sebastien Morais](https://github.com/SMoraisAnsys)
* [Umut Soysal](https://github.com/umutsoysal)
10 changes: 8 additions & 2 deletions docker/Dockerfile.linux → docker/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app

# Install unzip
RUN apt-get update && apt-get install -y unzip
RUN apt-get update && \
apt-get install -y --no-install-recommends unzip=6.0-26+deb11u1 && \
rm -rf /var/lib/apt/lists/*

# Add the binary files from the latest release
COPY linux-binaries.zip .
RUN unzip -qq linux-binaries.zip -d . && rm linux-binaries.zip && chmod -R 0755 DockerLinux && mv DockerLinux/bin/x64/Release_Linux/net6.0/* . && rm -rf DockerLinux
RUN unzip -qq linux-binaries.zip -d . && \
rm linux-binaries.zip && \
chmod -R 0755 DockerLinux && \
mv DockerLinux/bin/x64/Release_Linux/net6.0/* . && \
rm -rf DockerLinux

# Let the dynamic link loader where to search for shared libraries
ENV LD_LIBRARY_PATH="/app"
Expand Down
12 changes: 8 additions & 4 deletions docker/Dockerfile.windows → docker/windows/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# hadolint shell = cmd.exe
#
# Geometry service Windows-based Dockerfile
#
# Based on mcr.microsoft.com/dotnet/framework/runtime:4.7.2-windowsservercore-ltsc2019
Expand All @@ -15,10 +17,12 @@ WORKDIR /app

# Add the binary files from the latest release
COPY windows-binaries.zip .
RUN mkdir tmp_folder && tar -xf windows-binaries.zip -C tmp_folder
RUN xcopy "tmp_folder\DockerWindows\bin\x64\Release_Headless\net472\*" ".\" /s /e /i /h
RUN xcopy "tmp_folder\DockerWindows\*" ".\"
RUN del windows-binaries.zip && rmdir /s /q tmp_folder
RUN mkdir tmp_folder && \
tar -xf windows-binaries.zip -C tmp_folder && \
xcopy tmp_folder\DockerWindows\bin\x64\Release_Headless\net472\* . /e /i /h && \
xcopy tmp_folder\DockerWindows\* . && \
del windows-binaries.zip && \
rmdir /s /q tmp_folder

# Defining environment variables
ENV LICENSE_SERVER=""
Expand Down

0 comments on commit 0a920df

Please sign in to comment.