Docker Community Forums

Share and learn in the Docker community.

Accessing container port from host fails


(Toogley) #1


I have this Dockerfile:

FROM fedora:latest 

RUN dnf update --assumeyes 
RUN dnf install --assumeyes ruby-devel
RUN dnf install --assumeyes rubygems
RUN dnf install --assumeyes rubygems-devel
RUN dnf install --assumeyes libffi
RUN dnf install --assumeyes libffi-devel

# jekyll things 
RUN  dnf install --assumeyes rubygem-jekyll
RUN  dnf install --assumeyes rubygem-rb-inotify
RUN  gem install jekyll-gist
RUN  gem install jekyll-paginate
RUN  gem install jekyll-sass-converter
RUN  gem install jekyll-sitemap 

# tools
RUN dnf install --assumeyes git

RUN git clone

RUN ["/bin/bash"]

After these steps:

$ docker build -t fedora-jekyll .
$ docker run --publish-all=true -it fedora-jekyll /bin/bash
[root@ac7784beadbb /]# cd && jekyll serve
Configuration file: /
Configuration file: /
            Source: .
       Destination: ./_site
 Incremental build: disabled. Enable with --incremental
    Liquid Warning: Liquid syntax error (line 18): Unexpected character / in "{{}}" in feed.xml
                    done in 6.244 seconds.
 Auto-regeneration: enabled for '.'
Configuration file: /
    Server address:
  Server running... press ctrl-c to stop.

I can’t access from the host:

$ ping
ping: Name or service not known

How can i fix that?