As we know, many useful images don’t have a bash with the intention to save resources. (usually set a entrypoint )
I can’t set commands for these containers. A method is to set environment or mount a config file to the specific file.
For example: docker run -d -v config.yml:/etc/xxx/config.yml container p1 p2 p3
However, both in drone 0.8 and drone 1.0, this feature is unavailable.
In 0.8, the config.yml must be held by host machine, not in the git. (The alternative is to have a additional container moving the config from workspace to a host-volume, this should be trusted)
In 1.0, we can only mount a directory.
this is by design. commands are converted to a script and require a posix shell. If you do not have a posix shell installed inside your image, you can use the standard docker entrypoint and command arguments:
kind: pipeline
name: default
steps:
- name: test
image: alpine:3.8
entrypoint: [ /bin/uname ]
command: [ -a ]
Yes, entrypoint also can be replaced.
But it just solves a part of the problem.
What I really want is mount file A in workspace or say in git to file B in container
It’s powerful to configure a container by .yml file.
Sometimes the parameters are complex and with a large number.