Skip to content

Instantly share code, notes, and snippets.

@dduan
Created October 15, 2019 05:52
Show Gist options
  • Save dduan/af1a3d80602d9c316160937a046934f7 to your computer and use it in GitHub Desktop.
Save dduan/af1a3d80602d9c316160937a046934f7 to your computer and use it in GitHub Desktop.
Run DrString anywhere docker is available!
#!/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 "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment