ERROR: Named volume "pipeline_5d6e1fa1a6c4390f0b463fcc_trigger_5d6e200a2287a2849ea5f4fc:/app/output:rw" is used in service "pipeline_app_1" but no declaration was found in the volumes section.
I wasn’t able to see the linked issue. In any case, i wasn’t able to use relative paths either. Not sure if i did it wrong, but i checked with a Codefresh staff member and engineering is adding the enhancement for a freestyle step to be able to access volumes in service containers.
Yes, but only in the setup block (see first example I posted)
If you want it at the composition itself (not recommended) you still have to include it (second example I posted)
The idea is that in the setup block you preload the DB you use for testing or do some other init action, so you grab files from the shared Codefresh volume. And the volume is already there for you with no extra conf
@Kostis I’m still having challenges with shared volume. I’m getting the following error even though I’m following the documentation. The build spec snippet I’m using is below. Please advise.
Error Message:
[SYSTEM]
Message Failed to prepare composition: Run tests
Caused by Cannot start composition with warnings [“Volume mapping is not supported, try use:
/docker-entrypoint-initdb.d/mysql_init.sql”]
Documentation Link Composition · Codefresh | Docs
Pipeline executed successfully
Hey. It is exactly as this error message states. We don’t support volume directives with compositions.
Basically even though we still support compositions, we have since introduced service containers that are much better Service Containers · Codefresh | Docs
One of the advantages of service containers, is that you don’t have to mess with volumes any more. The main volume of the pipeline is already mounted to all services so you can freely access yours files from any service.
I looked at your example and you are still using the old composition syntax instead of the new one (service containers)
The support page that you reference is newer than the docs.
However, I cannot guarantee that it will work for you, because over the last months we have locked down several aspects of Codefresh, because of Cryptominer abuse.
I suggest you try the mounting of the socket in a composition and if it doesn’t work, please open a ticket with us so that we can investigate.
May I ask which tool you want to use in your Codefresh pipeline that required direct socket access to the docker daemon?
Did you eventually manage to get the test-containers up and running in code-fresh??
I think I’m stuck trying to get the service volumes to mount properly.