brave-wall-78117
11/28/2022, 8:05 AM./redis/redis.conf
is within the Pulumi project.
I tried using `HostPath = $"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}\redis\redis.conf",`but it exceeds the max path length of 255 and doesn't reach out that part.
dockerindexContainer (RedisContainer):
error: dockerindex/containerContainer resource 'RedisContainer' has a problem: './redis/redis.conf' must be an absolute path: './redis/redis.conf' must be an absolute path. Examine values at 'Container.Volumes'.
return await Deployment.RunAsync(() =>
{
var stackName = Deployment.Instance.StackName;
const string redisHost = "redis";
// Get configuration
var config = new Pulumi.Config();
var redisPort = config.RequireInt32("redisPort");
// Create network
var network = new Network("network", new NetworkArgs
{
Name = $"services-{stackName}"
});
// Find the latest redis image
var redisImage = new RemoteImage("RedisImage", new RemoteImageArgs
{
Name = "redis:alpine"
});
// Start a container
var redisContainer = new Container("RedisContainer", new ContainerArgs
{
Name = $"redis-{stackName}",
Image = redisImage.Latest,
Ports = new InputList<ContainerPortArgs>
{
new ContainerPortArgs
{
Internal = redisPort,
External = redisPort
}
},
Command = new InputList<string>
{
"redis-server /usr/local/etc/redis/redis.conf --requirepass mypassword"
},
Volumes = new InputList<ContainerVolumeArgs>
{
new ContainerVolumeArgs
{
HostPath = "./redis/redis.conf",
ContainerPath = "/usr/local/etc/redis/redis.conf"
}
},
NetworksAdvanced = new InputList<ContainerNetworksAdvancedArgs>
{
new ContainerNetworksAdvancedArgs
{
Name = network.Name,
Aliases = new[]
{
redisHost
}
}
},
});
// Export
return new Dictionary<string, object?>
{
["redisContainer"] = redisContainer.Name
};
});
shy-arm-32391
11/28/2022, 7:16 PMbrave-wall-78117
11/28/2022, 8:53 PMCommand
on newlines