Open ewrogers opened 6 years ago
Would this work? I haven't tried it in docker but it's how I handle my own automated screeps builds.
yes STEAM_KEY | npx screeps init
Interesting, the one thing I didn't try! I've just made an init.sh
script:
EDIT: Did try the yes STEAM_KEY | npx screeps init
with the same issue.
echo 'Copying initial world state...'
cp -avr ./node_modules/@screeps/launcher/init_dist/. .
if [ -n $STEAM_API_KEY ]
then
sed -i "s/{{STEAM_KEY}}/$STEAM_API_KEY/g" .screepsrc
fi
Please use ENV variables for such things (when you can't use config files), since you can see the command line args in the process list, which would be a security issue.
The combination of
npx
andprompt
library does not play nice when trying to runnpx screeps init
in a Docker build. It also does not work inside a Docker container either (prompt is never shown, hangs).It would be ideal if a command-line arg
--steam-api-key <key>
could be passed in toinit
(or allow that step to be skipped).This is pretty much the only blocker so far to a proper containerized screeps build.