Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
cdc9e85c
Commit
cdc9e85c
authored
Apr 26, 2019
by
Liang-Chi Hsieh
Committed by
Tianqi Chen
Apr 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use bridge network and expose port on macOS when launch docker image (#3086)
parent
1e84d04c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
docker/bash.sh
+7
-1
docs/install/docker.rst
+12
-1
No files found.
docker/bash.sh
View file @
cdc9e85c
...
...
@@ -35,7 +35,13 @@ DOCKER_IMAGE_NAME=("$1")
if
[
"$#"
-eq
1
]
;
then
COMMAND
=
"bash"
CI_DOCKER_EXTRA_PARAMS
=(
"-it --net=host"
)
if
[[
$(
uname
)
==
"Darwin"
]]
;
then
# Docker's host networking driver isn't supported on macOS.
# Use default bridge network and expose port for jupyter notebook.
CI_DOCKER_EXTRA_PARAMS
=(
"-it -p 8888:8888"
)
else
CI_DOCKER_EXTRA_PARAMS
=(
"-it --net=host"
)
fi
else
shift
1
COMMAND
=(
"
$@
"
)
...
...
docs/install/docker.rst
View file @
cdc9e85c
...
...
@@ -46,7 +46,8 @@ This auxiliary script does the following things:
- Mount current directory to /workspace
- Switch user to be the same user that calls the bash.sh (so you can read/write host system)
- Use the host-side network (so you can use jupyter notebook)
- Use the host-side network on Linux. Use the bridge network and expose port 8888 on macOS,
because host networking driver isn't supported. (so you can use jupyter notebook)
Then you can start a jupyter notebook by typing
...
...
@@ -55,6 +56,16 @@ Then you can start a jupyter notebook by typing
jupyter notebook
You might see an error ``OSError: [Errno 99] Cannot assign requested address`` when starting
a jupyter notebook on macOS. You can change the binding IP address by
.. code:: bash
jupyter notebook --ip=0.0.0.0
Note that on macOS, because we use bridge network, jupyter notebook will be reportedly running
at an URL like ``http://{container_hostname}:8888/?token=...``. You should replace the ``container_hostname``
with ``localhost`` when pasting it into browser.
Docker Source
-------------
...
...
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