if you have a container that with something running on its port 8000, you can run

wget http://container_ip:8000

To get the container′s ip address, run the 2 commands:

docker ps

docker inspect container_name | grep IPAddress

Internally, Docker shells out to call iptables when you run an image, so maybe some variation on this will work.

to expose the container's port 8000 on your localhosts port 8001:

iptables -t nat -A DOCKER -p tcp --dport  -j DNAT --to-destination 172.17.0.2:

expose a port on a living Docker container的更多相关文章

  1. Docker container network configuration

    http://xmodulo.com/networking-between-docker-containers.html How to set up networking between Docker ...

  2. Docker4Windows -- 从外部(非本机host)访问 由docker container运行的程序

    背景 当我们在windows 上面运行docker container的时候,我们需要借助于模拟器(例如,Virtual box/Hyper V),她的目的主要是在我们的windows系统上面模拟出一 ...

  3. Docker: docker container常用命令实战

    容器管理,容器常用选项 选项 描述 -i, –interactive 交互式 -t, –tty 分配一个伪终端 -d, –detach 运行容器到后台 -e, –env 设置环境变量 -p, –pub ...

  4. Docker Container同时启动多服务 supervisor

    Docker Container同时启动多服务 转载请注明来自:http://blog.csdn.net/wsscy2004 昨天踩了个天坑,我有一个基本的镜像centos6.5+ssh,是通过Doc ...

  5. Docker container 集装箱说明

    容器操作 使用 docker 命令行操作 docker 容器 启动容器 core@localhost ~ $ docker run Usage: docker run [OPTIONS] IMAGE ...

  6. docker container(容器)

    docker 容器 Docker容器类似于一个轻量级的沙箱,Docker利用容器来运行和隔离应用 容器是从镜像创建的应用运行实例.它可以启动,开始,停止,删除,而这些容器都是彼此相互隔离,互不可见的. ...

  7. Docker源码分析(八):Docker Container网络(下)

    1.Docker Client配置容器网络模式 Docker目前支持4种网络模式,分别是bridge.host.container.none,Docker开发者可以根据自己的需求来确定最适合自己应用场 ...

  8. Docker - 命令 - docker container

    概述 整理 docker 容器的命令 1. 分类(25个) 查看 ls diff logs inspect port stats top 生命周期 pause prune create kill re ...

  9. 使Docker Container支持运行SWT程序

    1, 下载安装JDK的docker container 我是从这个源下载已经做好的JDK8的container: https://registry.hub.docker.com/u/dockerfil ...

随机推荐

  1. BFS的小结

    写这类搜索题.首先感觉要有个框架.比如我的框架对于BFS来说(对于DFS,我想有两个一个是递归版一个是栈版).这里是BFS小结.所以介绍一下BFS.我的框架.(也是搜集了网上许多神人的作品.) 1:节 ...

  2. 2017 ICPC beijing F - Secret Poems

    #1632 : Secret Poems 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 The Yongzheng Emperor (13 December 1678 – ...

  3. C++中typedef和#define简介

    本文基于<C++ Primer(第5版)>和网上博客,整理而成. 一.类型别名 类型别名是一个名字,它是某种类型的同义词,有两种方法可用于定义类型别名:typedef.using. 1.关 ...

  4. [Leetcode] restore ip address 存储IP地址

    Given a string containing only digits, restore it by returning all possible valid IP address combina ...

  5. [NOIP 2005] 运输计划

    link 这是一道假的图论 思维难度很低,代码量偏高 就是一道板子+二分 树上差分就AC了 注意卡常即可 二分枚举答案x,为时间长度 将每一个长度大于x的计划链长记录下来(有几个,总需要减少多少长度) ...

  6. 解密百度图片URL

    今天想爬百度图片搜索,但因为爬出来的链接乱七八糟,有些打不开,对于我这个完美主义者而言,这实在是太残酷,但我还是把爬虫过程的核心部分——解密URL给记录下来了. 下图是捕获的json数据的其中一条数据 ...

  7. Codeforces Round #345 (Div. 2) B

    B. Beautiful Paintings time limit per test 1 second memory limit per test 256 megabytes input standa ...

  8. run (牛客多校第二场)计数DP

    链接:https://www.nowcoder.com/acm/contest/140/A来源:牛客网 题目描述 White Cloud is exercising in the playground ...

  9. ACM.hdu1025

    to get the ans of how many roads at most that can be built between two line without intersection of ...

  10. Java注释@interface的用法【转】 --好文章 很好理解

    java用  @interface Annotation{ } 定义一个注解 @Annotation,一个注解是一个类. @Override,@Deprecated,@SuppressWarnings ...