Skip to content

Instantly share code, notes, and snippets.

@dduan
Created October 15, 2019 05:52
Show Gist options
  • Select an option

  • Save dduan/af1a3d80602d9c316160937a046934f7 to your computer and use it in GitHub Desktop.

Select an option

Save dduan/af1a3d80602d9c316160937a046934f7 to your computer and use it in GitHub Desktop.

Revisions

  1. dduan created this gist Oct 15, 2019.
    14 changes: 14 additions & 0 deletions drstring.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/bin/bash

    temp_file=$(mktemp)

    echo 'FROM swift@sha256:c4d53af406c5dc48bd43c0d313f3ed80924eee4bf78907ce4ad6eb8f5513f376' >> temp_file
    echo 'RUN git clone https://github.com/dduan/DrString.git; cd DrString; make build; cp .build/release/drstring /bin/drstring' >> temp_file
    echo 'RUN rm -rf /data' >> temp_file
    echo 'ADD . /data' >> temp_file
    echo 'WORKDIR /data' >> temp_file
    echo 'ENTRYPOINT ["drstring"]' >> temp_file

    IMAGE=drstring-execute
    docker build -t $IMAGE -f temp_file . &> /dev/null
    docker --log-level fatal run --rm $IMAGE "$@"