加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
floatsmith-docker 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env bash
# check for Docker image
if [ -z "$(docker image ls -q floatsmith)" ]; then
echo "Docker image 'floatsmith' isn't present. Attempting to build it now ... (may take some time)"
# save current path
CURPATH=$(pwd)
# get the path of this script, regardless of any symlinks (works on Linux and BSD)
# (from https://stackoverflow.com/a/246128)
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
cd $DIR/docker
# build Docker image
./build.sh
# check to make sure build worked
if [ -z "$(docker image ls -q floatsmith)" ]; then
echo "Unable to find 'floatsmith' image. Aborting."
exit 1
fi
# back to original location
cd $CURPATH
fi
# launch container
docker run -v $(pwd):/local -it floatsmith
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化