Summary: public Add instructions how to use the docker image, a script to automatically build and run the docker container, and base the docker image on the latest release of infer instead of git, which saves compiling clang. Reviewed By: cristianoc Differential Revision: D2564909 fb-gh-sync-id: 5c8ea96master
parent
9b15656258
commit
f2d80d1a40
@ -0,0 +1,31 @@
|
|||||||
|
# docker images for Infer
|
||||||
|
|
||||||
|
This directory contains a docker file to install Infer within a
|
||||||
|
[docker](https://www.docker.com/) container. This can be used to
|
||||||
|
quickly try Infer or to deploy Infer.
|
||||||
|
|
||||||
|
|
||||||
|
## Pre-requisites
|
||||||
|
|
||||||
|
To use this docker image, you will need a working docker
|
||||||
|
installation. See the instructions for
|
||||||
|
[Linux](http://docs.docker.com/linux/step_one/) or
|
||||||
|
[MacOSX](http://docs.docker.com/mac/step_one/) as appropriate.
|
||||||
|
|
||||||
|
|
||||||
|
## How to use
|
||||||
|
|
||||||
|
This docker file will use the latest
|
||||||
|
[released](https://github.com/facebook/infer/releases) version of
|
||||||
|
Infer. Simply type "./run.sh" to get a shell inside the docker
|
||||||
|
container. It will have built and installed Infer. You can then try
|
||||||
|
out Infer on the introductory examples:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# compiles Infer; this takes a few minutes
|
||||||
|
./run.sh
|
||||||
|
# you should now be inside the docker container with a shell prompt, e.g.
|
||||||
|
# "root@5c3b9af90d59:/# "
|
||||||
|
cd /infer/examples/android_hello/
|
||||||
|
infer -- gradle build
|
||||||
|
```
|
@ -0,0 +1,51 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Copyright (c) 2015 - present Facebook, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the BSD style license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
# of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
|
EXEC_NAME="$0"
|
||||||
|
|
||||||
|
show_usage() {
|
||||||
|
echo "Usage: $EXEC_NAME [-h]"
|
||||||
|
echo ""
|
||||||
|
echo "Build and run the docker image. See infer/docker/README.md for more"
|
||||||
|
echo "information."
|
||||||
|
echo ""
|
||||||
|
echo "Options:"
|
||||||
|
echo " -h, --help Show this message and exit"
|
||||||
|
}
|
||||||
|
|
||||||
|
while [ -n "$1" ]; do
|
||||||
|
arg="$1"
|
||||||
|
case $arg in
|
||||||
|
"-h" | "--help" )
|
||||||
|
show_usage;
|
||||||
|
exit 0;
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "unknown argument $1"
|
||||||
|
show_usage;
|
||||||
|
exit 1;
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if ! docker --version > /dev/null; then
|
||||||
|
echo "docker install not working"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f Dockerfile ]; then
|
||||||
|
echo "Dockerfile not found. Are you in the right directory?"
|
||||||
|
echo "Please see infer/docker/README.md for more information."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
NAME="infer"
|
||||||
|
|
||||||
|
docker build -t $NAME . && \
|
||||||
|
docker run -it $NAME /bin/bash
|
Loading…
Reference in new issue