Question Regarding Port Issue With Container Resource #1894
Answered
by
josephaw1022
josephaw1022
asked this question in
Q&A
-
Ok so I am currently trying to run this program.cs file in my app host project var builder = DistributedApplication.CreateBuilder(args);
var minioContainer = builder.AddContainer("minio", "minio/minio")
.WithServiceBinding(containerPort: 9000, name: "minio-container-port")
.WithServiceBinding(containerPort: 9001, name: "minio-console-port")
.WithEnvironment("MINIO_ROOT_USER", "minio")
.WithEnvironment("MINIO_ROOT_PASSWORD", "RunningZebraMan32332#")
.WithArgs("server", "/data", "--console-address", "\"9001\"");
builder.AddProject<Projects.ApiWithS3>("apiwiths3");
builder.AddProject<Projects.ApiWithMinio>("apiwithminio");
builder.Build().Run(); and I am getting this error when I run the app host When I run the minio container with no admin port, it works just fine. var builder = DistributedApplication.CreateBuilder(args);
var minioContainer = builder.AddContainer("minio", "minio/minio")
.WithServiceBinding(containerPort: 9000, name: "minio-container-port")
.WithEnvironment("MINIO_ROOT_USER", "minio")
.WithEnvironment("MINIO_ROOT_PASSWORD", "RunningZebraMan32332#")
.WithArgs("server", "/data");
builder.AddProject<Projects.ApiWithS3>("apiwiths3");
builder.AddProject<Projects.ApiWithMinio>("apiwithminio");
builder.Build().Run(); and I get this NoteThe command for the container doesn't seem to be the issue as it works in this compose file # ... rest of file
# Minio service
minio:
image: minio/minio
ports:
- '9002:9000'
- '9001:9001'
volumes:
- minio:/data
restart: unless-stopped
env_file: './config/minio.env'
command: server --console-address ":9001" /data
My QuestionHow do I get the first command to work with the console endpoint? Not sure what I need to do to make the first example I showed work. |
Beta Was this translation helpful? Give feedback.
Answered by
josephaw1022
Jan 27, 2024
Replies: 1 comment
-
Nevermind got it working!! var builder = DistributedApplication.CreateBuilder(args);
var minioContainer = builder.AddContainer("minio", "minio/minio")
.WithServiceBinding(containerPort: 9000, name: "minio-container-port", hostPort: 9000)
.WithServiceBinding(containerPort: 9001, name: "minio-console-port", hostPort:9001)
.WithEnvironment("MINIO_ROOT_USER", "minio")
.WithEnvironment("MINIO_ROOT_PASSWORD", "RunningZebraMan32332#")
.WithEnvironment("MINIO_ADDRESS", ":9000")
.WithEnvironment("MINIO_CONSOLE_ADDRESS", ":9001")
.WithArgs("server", "/data");
builder.AddProject<Projects.ApiWithS3>("apiwiths3");
builder.AddProject<Projects.ApiWithMinio>("apiwithminio");
builder.Build().Run(); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
josephaw1022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nevermind got it working!!