Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
e11bbd78
Unverified
提交
e11bbd78
authored
3月 19, 2019
作者:
Steven Allen
提交者:
GitHub
3月 19, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6100 from ipfs/gomod/dockerfile
gomod: Update Dockerfile, remove Dockerfile.fast
上级
27ae4fde
60a43f89
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
10 行增加
和
88 行删除
+10
-88
Dockerfile
Dockerfile
+7
-10
Dockerfile.fast
Dockerfile.fast
+0
-75
Makefile
test/3nodetest/Makefile
+1
-1
t0300-docker-image.sh
test/sharness/t0300-docker-image.sh
+1
-1
t0301-docker-migrate.sh
test/sharness/t0301-docker-migrate.sh
+1
-1
没有找到文件。
Dockerfile
浏览文件 @
e11bbd78
FROM
golang:1.1
1
-stretch
FROM
golang:1.1
2
-stretch
MAINTAINER
Lars Gierth <lgierth@ipfs.io>
# There is a copy of this Dockerfile called Dockerfile.fast,
# which is optimized for build time, instead of image size.
#
# Please keep these two Dockerfiles in sync.
ENV
SRC_DIR /go-ipfs
ENV
GX_IPFS ""
ENV
SRC_DIR /go/src/github.com/ipfs/go-ipfs
# Download packages first so they can be cached.
COPY
go.mod go.sum $SRC_DIR/
RUN
cd
$SRC_DIR
\
&&
go mod download
COPY
. $SRC_DIR
# Build the thing.
# Also: fix getting HEAD commit hash via git rev-parse.
# Also: allow using a custom IPFS API endpoint.
RUN
cd
$SRC_DIR
\
&&
mkdir .git/objects
\
&&
([
-z
"
$GX_IPFS
"
]
||
echo
$GX_IPFS
>
/root/.ipfs/api
)
\
&&
make build
# Get su-exec, a very minimal tool for dropping privileges,
...
...
@@ -41,7 +38,7 @@ FROM busybox:1-glibc
MAINTAINER
Lars Gierth <lgierth@ipfs.io>
# Get the ipfs binary, entrypoint script, and TLS CAs from the build container.
ENV
SRC_DIR /go
/src/github.com/ipfs/go
-ipfs
ENV
SRC_DIR /go-ipfs
COPY
--from=0 $SRC_DIR/cmd/ipfs/ipfs /usr/local/bin/ipfs
COPY
--from=0 $SRC_DIR/bin/container_daemon /usr/local/bin/start_ipfs
COPY
--from=0 /tmp/su-exec/su-exec /sbin/su-exec
...
...
Dockerfile.fast
deleted
100644 → 0
浏览文件 @
27ae4fde
FROM golang:1.11-stretch
MAINTAINER Lars Gierth <lgierth@ipfs.io>
# This is a copy of /Dockerfile,
# except that we optimize for build time, instead of image size.
#
# Please keep these two Dockerfiles in sync.
ENV GX_IPFS ""
ENV SRC_DIR /go/src/github.com/ipfs/go-ipfs
COPY ./package.json $SRC_DIR/package.json
# Fetch dependencies.
# Also: allow using a custom IPFS API endpoint.
RUN set -x \
&& go get github.com/whyrusleeping/gx \
&& go get github.com/whyrusleeping/gx-go \
&& ([ -z "$GX_IPFS" ] || echo $GX_IPFS > /root/.ipfs/api) \
&& cd $SRC_DIR \
&& gx install
COPY . $SRC_DIR
# Build the thing.
# Also: fix getting HEAD commit hash via git rev-parse.
RUN set -x \
&& cd $SRC_DIR \
&& mkdir .git/objects \
&& make build \
&& mv cmd/ipfs/ipfs /usr/local/bin/ipfs \
&& mv bin/container_daemon /usr/local/bin/start_ipfs
# Get su-exec, a very minimal tool for dropping privileges,
# and tini, a very minimal init daemon for containers
ENV SUEXEC_VERSION v0.2
ENV TINI_VERSION v0.16.1
RUN set -x \
&& cd /tmp \
&& git clone https://github.com/ncopa/su-exec.git \
&& cd su-exec \
&& git checkout -q $SUEXEC_VERSION \
&& make \
&& cd /tmp \
&& wget -q -O tini https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini \
&& chmod +x tini \
&& mv su-exec/su-exec tini /sbin/ # Install them
# Ports for Swarm TCP, Swarm uTP, API, Gateway, Swarm Websockets
EXPOSE 4001
EXPOSE 4002/udp
EXPOSE 5001
EXPOSE 8080
EXPOSE 8081
# Create the fs-repo directory and switch to a non-privileged user.
ENV IPFS_PATH /data/ipfs
RUN mkdir -p $IPFS_PATH \
&& useradd -s /usr/sbin/nologin -d $IPFS_PATH -u 1000 -G users ipfs \
&& chown ipfs:users $IPFS_PATH
# Expose the fs-repo as a volume.
# start_ipfs initializes an fs-repo if none is mounted.
VOLUME $IPFS_PATH
# The default logging level
ENV IPFS_LOGGING ""
# This just makes sure that:
# 1. There's an fs-repo, and initializes one if there isn't.
# 2. The API and Gateway are accessible from outside the container.
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/start_ipfs"]
# Execute the daemon subcommand by default
CMD ["daemon", "--migrate=true"]
test/3nodetest/Makefile
浏览文件 @
e11bbd78
...
...
@@ -24,7 +24,7 @@ data/filerand: ../bin/random
# just build it every time... this part isn't
# even the lengthy part, and it decreases pain.
docker_ipfs_image
:
docker build
-t
$(IMAGE_NAME)
-f
Dockerfile
.fast
.
docker build
-t
$(IMAGE_NAME)
-f
Dockerfile .
docker images |
grep
$(IMAGE_NAME)
clean
:
...
...
test/sharness/t0300-docker-image.sh
浏览文件 @
e11bbd78
...
...
@@ -33,7 +33,7 @@ TEST_TESTS_DIR=$(dirname "$TEST_SCRIPTS_DIR")
APP_ROOT_DIR
=
$(
dirname
"
$TEST_TESTS_DIR
"
)
test_expect_success
"docker image build succeeds"
'
docker_build "$TEST_TESTS_DIR/../Dockerfile
.fast
" "$APP_ROOT_DIR" >actual ||
docker_build "$TEST_TESTS_DIR/../Dockerfile" "$APP_ROOT_DIR" >actual ||
test_fsh echo "TEST_TESTS_DIR: $TEST_TESTS_DIR" ||
test_fsh echo "APP_ROOT_DIR : $APP_ROOT_DIR" ||
test_fsh cat actual
...
...
test/sharness/t0301-docker-migrate.sh
浏览文件 @
e11bbd78
...
...
@@ -21,7 +21,7 @@ TEST_TESTS_DIR=$(dirname "$TEST_SCRIPTS_DIR")
APP_ROOT_DIR
=
$(
dirname
"
$TEST_TESTS_DIR
"
)
test_expect_success
"docker image build succeeds"
'
docker_build "$TEST_TESTS_DIR/../Dockerfile
.fast
" "$APP_ROOT_DIR" >actual &&
docker_build "$TEST_TESTS_DIR/../Dockerfile" "$APP_ROOT_DIR" >actual &&
IMAGE_ID=$(tail -n1 actual | cut -d " " -f 3)
'
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论