Configuration labels are special Docker Compose labels that can be assigned to containers in your docksal.yml
or docksal-local.yml
files and impact how containers function in Docksal.
For example this will create a yoda
service, based on cli
, that has shell and user overridden so that npm
and node
commands would execute properly against it (e.g., fin exec --in=yoda npm -v
).
services:
yoda:
labels:
- io.docksal.shell=bash
- io.docksal.user=docker
extends:
file: ${HOME}/.docksal/stacks/services.yml
service: cli
Specify which shell to use when fin exec --in=container ...
or fin bash container
commands are executed for the container.
You must make sure that the shell you specify is installed in the container or the command will fail.
Specify which user to use when fin exec --in=container ...
or fin bash container
commands are executed for the container.
Assign custom virtual host for a container. This will only make sense if the container exposes a web interface, e.g.,
labels:
- io.docksal.virtual-host=nodeapp.${VIRTUAL_HOST}
Assign to which port on the destination container to route web requests, e.g., for node app that exposes port 3000
labels:
- io.docksal.virtual-host=nodeapp.${VIRTUAL_HOST}
- io.docksal.virtual-port=3000
Was this page helpful?
Thanks for the feedback. If you have a specific, answerable question about how to use Docksal, ask it in Discussions on GitHub. Open an issue if you want to report a problem or suggest an improvement. You can also contribute changes to this page using the link in the top right corner.