Trying to install some small packages into a container via compose w/out resorting to having to use my own dockerfile
, but whether I try mounting just the folder, and calling the script, like:
volumes:
- '/opt/docker/configs/extras:/home'
command:
- 'bash /home/install-extra-stuff.sh'
or mounting the file directly and calling it, like:
volumes:
- '/opt/docker/configs/extras/install-extra-stuff.sh:/home/install-extra-stuff.sh'
command:
- 'bash /home/install-extra-stuff.sh'
I get an error that the file doesn't exist
ifelse: fatal: unable to exec bash /home/install-extra-stuff.sh: No such file or directory today at 6:10 PM [cmd] bash /home/install-extra-stuff.sh exited 127
The script itself contains:
#!/bin/bash
# Ping
apt-get update && apt install iputils-ping -y
Hopping into the container itself and running those commands after it has started with those lines above commented out, installs the package just fine.
Any ideas (other than use a dockerfile
?)
- ["bash", "/home/install-extra-stuff.sh"]
or- bash /home/install-extra-stuff.sh
FROM
line at the start of the file, andRUN
before theapt-get ...
command. Why not use that?