Comments (4)
Bollard aligns with the Swagger specification as much as possible:
https://github.com/moby/moby/blob/master/api/swagger.yaml#L1230-L1245
As the example is "80/tcp": {}
this translates to HashMap<&str, HashMap<(), ()>>
from bollard.
Ok, thanks for the clarification on the shape of the API.
I am finding that I don't understand how to create the right hashmap such that 9000/tcp
is exposed on localhost for a container I start with bollard. For clarification, I am attempting to emulate docker run -d --rm -p "9000:9000" minio/minio:latest server /data
with the following bollard::container::Config
:
let minio_config = Config {
image: Some(MINIO_IMAGE),
exposed_ports: Some(HashMap::from([
("9000:9000", empty.clone()),
// ("9001:9001", empty.clone()),
])),
env: Some(vec![
"MINIO_ROOT_USER=testuser",
"MINIO_ROOT_PASSWORD=testpass",
]),
// no need to start console when controlling with docker exec and opendal
cmd: Some(vec!["server", "/data"]),
..Default::default()
};
Am I using the wrong part of the API to accomplish this?
After some more investigation, it looks like I should be utilizing host_config
?
from bollard.
After some more investigation, it looks like I should be utilizing
host_config
?
Yep, exposing and publishing ports are different. See similar discussion in this issue: #340
from bollard.
Thank you! This issue can be closed now
from bollard.
Related Issues (20)
- Stream doesn't close after exec log
- Problems Connecting w/ HTTP HOT 1
- How to import images from tar using stream HOT 3
- docker manifest inspect
- Add Docker Socket availability check during connection creation HOT 3
- Unexplained race condition in v0.16 causing "runtime dropped the dispatch task" HOT 8
- Support for multiple image build tags? HOT 1
- code is inactive due to #[cfg] directives: feature = "buildkit" is disabled HOT 4
- How to specify multi-stage build target in build_image? HOT 1
- Looking for help: Created container seem to be not listen to export and published port HOT 1
- Add a `Docker::connect_with_url()` method HOT 4
- Generic strategy for health checking a container? HOT 1
- Unclear error when docker is not running HOT 2
- UpdateContainerOptions has i_ops and cp_us instead of iops and cpus HOT 2
- Is it possible to use list_containers without type params? HOT 2
- Custom Build Outputs `--output` HOT 10
- Cutting out a new minor release HOT 1
- Unable to anonymously pull an image from ghcr.io when using BuildKit HOT 7
- Feature request: allow HTTP request customizations
- Both ring and aws-lc-rs provider are enabled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bollard.