From b70227774ce3a5910ce865216c912acaab259bbc Mon Sep 17 00:00:00 2001 From: Akos Hajdu Date: Tue, 11 Aug 2020 12:42:00 +0200 Subject: [PATCH] Use workdir in dockerfiles --- .github/workflows/docker-tools.yml | 2 +- build.gradle.kts | 2 +- docker/theta-cfa-cli.Dockerfile | 9 ++++----- docker/theta-sts-cli.Dockerfile | 9 ++++----- docker/theta-xta-cli.Dockerfile | 7 +++---- subprojects/cfa-cli/README.md | 6 +++--- subprojects/sts-cli/README.md | 6 +++--- subprojects/xta-cli/README.md | 6 +++--- 8 files changed, 22 insertions(+), 25 deletions(-) diff --git a/.github/workflows/docker-tools.yml b/.github/workflows/docker-tools.yml index a8d9f8d1dd..9e9e81baa7 100644 --- a/.github/workflows/docker-tools.yml +++ b/.github/workflows/docker-tools.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Build sts Docker image + - name: Build STS Docker image run: docker build -t theta-sts-cli -f docker/theta-sts-cli.Dockerfile . - name: Run STS docker on example run: ./docker/run-theta-sts-cli.sh subprojects/sts/src/test/resources/simple1.system diff --git a/build.gradle.kts b/build.gradle.kts index 55720ecd32..db6563c523 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ buildscript { allprojects { group = "hu.bme.mit.inf.theta" - version = "1.4.3" + version = "1.4.4" apply(from = rootDir.resolve("gradle/shared-with-buildSrc/mirrors.gradle.kts")) } diff --git a/docker/theta-cfa-cli.Dockerfile b/docker/theta-cfa-cli.Dockerfile index eba1761ac1..a4ee2163be 100644 --- a/docker/theta-cfa-cli.Dockerfile +++ b/docker/theta-cfa-cli.Dockerfile @@ -5,12 +5,11 @@ RUN apt-get update && \ RUN mkdir theta COPY . theta -RUN cd theta && \ - ./gradlew theta-cfa-cli:build && \ - cd .. && \ - mv theta/subprojects/cfa-cli/build/libs/theta-cfa-cli-*-all.jar ./theta-cfa-cli.jar +WORKDIR theta +RUN ./gradlew theta-cfa-cli:build && \ + mv subprojects/cfa-cli/build/libs/theta-cfa-cli-*-all.jar ../theta-cfa-cli.jar +WORKDIR .. ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./theta/lib/" - ENTRYPOINT ["java", "-jar", "theta-cfa-cli.jar"] diff --git a/docker/theta-sts-cli.Dockerfile b/docker/theta-sts-cli.Dockerfile index cf24db5854..3a126a2922 100644 --- a/docker/theta-sts-cli.Dockerfile +++ b/docker/theta-sts-cli.Dockerfile @@ -5,11 +5,10 @@ RUN apt-get update && \ RUN mkdir theta COPY . theta -RUN cd theta && \ - ./gradlew theta-sts-cli:build && \ - cd .. && \ - mv theta/subprojects/sts-cli/build/libs/theta-sts-cli-*-all.jar ./theta-sts-cli.jar +WORKDIR theta +RUN ./gradlew theta-sts-cli:build && \ + mv theta/subprojects/sts-cli/build/libs/theta-sts-cli-*-all.jar ../theta-sts-cli.jar +WORKDIR .. ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./theta/lib/" - ENTRYPOINT ["java", "-jar", "theta-sts-cli.jar"] diff --git a/docker/theta-xta-cli.Dockerfile b/docker/theta-xta-cli.Dockerfile index fe8298eb46..f5ca5f448d 100644 --- a/docker/theta-xta-cli.Dockerfile +++ b/docker/theta-xta-cli.Dockerfile @@ -5,12 +5,11 @@ RUN apt-get update && \ RUN mkdir theta COPY . theta -RUN cd theta && \ +WORKDIR theta ./gradlew theta-xta-cli:build && \ - cd .. && \ - mv theta/subprojects/xta-cli/build/libs/theta-xta-cli-*-all.jar ./theta-xta-cli.jar + mv theta/subprojects/xta-cli/build/libs/theta-xta-cli-*-all.jar ../theta-xta-cli.jar +WORKDIR .. ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./theta/lib/" - ENTRYPOINT ["java", "-jar", "theta-xta-cli.jar"] diff --git a/subprojects/cfa-cli/README.md b/subprojects/cfa-cli/README.md index 1821194a3a..6495a096d4 100644 --- a/subprojects/cfa-cli/README.md +++ b/subprojects/cfa-cli/README.md @@ -19,9 +19,9 @@ The runnable jar file will appear under _build/libs/_ with the name _theta-cfa-c More information can also be found below. - For example `java -jar theta-cfa-cli.jar --model counter.cfa --loglevel INFO` runs the default analysis with logging on the `counter.cfa` input file. -### Docker (beta) +### Docker -An experimental Dockerfile is also available under the _docker_ directory in the root of the repository. +A Dockerfile is also available under the _docker_ directory in the root of the repository. The image can be built using the following command (from the root of the repository): ``` docker build -t theta-cfa-cli -f docker/theta-cfa-cli.Dockerfile . @@ -90,4 +90,4 @@ Otherwise, the output is simply in `dot` format. | Flag | Description | |--|--| | `--benchmark` | Benchmark mode, only print metrics in csv format. | -| `--header` | Print the header for the benchmark mode csv format. | \ No newline at end of file +| `--header` | Print the header for the benchmark mode csv format. | diff --git a/subprojects/sts-cli/README.md b/subprojects/sts-cli/README.md index ea60f7c624..df06a10e87 100644 --- a/subprojects/sts-cli/README.md +++ b/subprojects/sts-cli/README.md @@ -19,9 +19,9 @@ The runnable jar file will appear under _build/libs/_ with the name _theta-sts-c More information can also be found below. - For example `java -jar theta-sts-cli.jar --model counter.system --loglevel INFO` runs the default analysis with logging on the `counter.system` input file. -### Docker (beta) +### Docker -An experimental Dockerfile is also available under the _docker_ directory in the root of the repository. +A Dockerfile is also available under the _docker_ directory in the root of the repository. The image can be built using the following command (from the root of the repository): ``` docker build -t theta-sts-cli -f docker/theta-sts-cli.Dockerfile . @@ -73,4 +73,4 @@ All arguments are optional, except `--model`. | Flag | Description | |--|--| | `--benchmark` | Benchmark mode, only print metrics in csv format. | -| `--header` | Print the header for the benchmark mode csv format. | \ No newline at end of file +| `--header` | Print the header for the benchmark mode csv format. | diff --git a/subprojects/xta-cli/README.md b/subprojects/xta-cli/README.md index 0c69d7ceeb..18d3d406af 100644 --- a/subprojects/xta-cli/README.md +++ b/subprojects/xta-cli/README.md @@ -17,9 +17,9 @@ The runnable jar file will appear under _build/libs/_ with the name _theta-xta-c - If no arguments are given, a help screen is displayed about the arguments and their possible values. More information can also be found below. -### Docker (beta) +### Docker -An experimental Dockerfile is also available under the _docker_ directory in the root of the repository. +A Dockerfile is also available under the _docker_ directory in the root of the repository. The image can be built using the following command (from the root of the repository): ``` docker build -t theta-xta-cli -f docker/theta-xta-cli.Dockerfile . @@ -29,4 +29,4 @@ The script `run-theta-xta-cli.sh` can be used for running the containerized vers ``` ./run-theta-xta-cli.sh model.xta [OTHER FLAGS] ``` -Note that the model must be given as the first positional argument (without `--model`). \ No newline at end of file +Note that the model must be given as the first positional argument (without `--model`).