Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
ff1e58a4
Commit
ff1e58a4
authored
Apr 27, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1128 from Luzifer/dockerfile_expose
Improve Dockerfile
parents
196c6aa4
3534b039
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
Dockerfile
Dockerfile
+11
-2
bin/container_daemon
bin/container_daemon
+19
-3
No files found.
Dockerfile
View file @
ff1e58a4
FROM
golang:1.4
MAINTAINER
Brian Tiger Chow <btc@perfmode.com>
ENV
IPFS_PATH /data/ipfs
RUN
useradd
-m
-d
/data
-u
1000 ipfs
&&
\
mkdir
-p
/data/ipfs
&&
chown
ipfs:ipfs /data/ipfs
EXPOSE
4001 5001 8080
# 4001 = Swarm, 5001 = API, 8080 = HTTP transport
VOLUME
/data/ipfs
ADD
. /go/src/github.com/ipfs/go-ipfs
RUN
cd
/go/src/github.com/ipfs/go-ipfs/cmd/ipfs
&&
go
install
RUN
cp
/go/src/github.com/ipfs/go-ipfs/bin/container_daemon /usr/local/bin/start_ipfs
&&
\
chmod
755 /usr/local/bin/start_ipfs
EXPOSE
4001 5001 8080
# 4001 = Swarm, 5001 = API, 8080 = HTTP transport
USER
ipfs
ENTRYPOINT
["/usr/local/bin/start_ipfs"]
...
...
bin/container_daemon
View file @
ff1e58a4
#!/bin/bash
ipfs init
ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
# Test whether the mounted directory is writable for us
if
(
touch
/data/ipfs/write_test 2>/dev/null
)
;
then
rm
/data/ipfs/write_test
else
echo
"ERR: /data/ipfs is not writable for user 'ipfs' (UID 1000)"
exit
1
fi
echo
"Running
$(
ipfs version
)
..."
if
[
-e
/data/ipfs/config
]
;
then
echo
"Found ipfs repository. Not initializing."
else
ipfs init
ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
fi
ipfs daemon
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment