代码拉取完成,页面将自动刷新
#!/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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。