diff --git a/.github/workflows/tem_dockerbuild.yml b/.github/workflows/tem_dockerbuild.yml new file mode 100644 index 00000000..b5c392e7 --- /dev/null +++ b/.github/workflows/tem_dockerbuild.yml @@ -0,0 +1,53 @@ +name: "Building TEM simulator container" + +on: + push: + branches: [master,temsim-container] + paths: + - 'docker/TEM-simulator/Dockerfile' + + pull_request: + branch: [master] + paths: + - 'docker/TEM-simulator/Dockerfile' + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Check Out Repo + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./docker/TEM-simulator/Dockerfile + builder: ${{ steps.buildx.outputs.name }} + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/simspi-temsimulator:latest + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file diff --git a/docker/TEM-simulator/Dockerfile b/docker/TEM-simulator/Dockerfile new file mode 100644 index 00000000..8ba744f4 --- /dev/null +++ b/docker/TEM-simulator/Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu:18.04 + +WORKDIR /work + +RUN apt-get update && \ + apt-get install -y git wget unzip build-essential + +RUN wget 'http://www.fftw.org/fftw-3.3.10.tar.gz' && \ + tar -xzvf fftw-3.3.10.tar.gz && \ + cd fftw-3.3.10 && ./configure && make && make install && \ + cd /work && rm -rf fftw-3.3.10* + +RUN wget 'https://iweb.dl.sourceforge.net/project/tem-simulator/TEM-simulator_1.3.zip' && \ + unzip TEM-simulator_1.3.zip && \ + cd TEM-simulator_1.3/src && make && \ + cd /work && rm -f TEM-simulator_1.3.zip + +ENV PATH=/work/TEM-simulator/src:$PATH