Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
272 views
in Technique[技术] by (71.8m points)

Run docker command in Heroku

I have an image that I need to start with special run arguments, i.e: docker run --cap-add=SYS_ADMIN.

How can I achieve this with Heroku?


Here's what I've tried -

In my package.json I have

"start": "docker run --cap-add=SYS_ADMIN..."

In Dockerfile I have

RUN npm start

But when I start the dyno and run heroku logs --tail I get

docker is not a command

question from:https://stackoverflow.com/questions/65909381/run-docker-command-in-heroku

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It is not possible as containers cannot be run with root privileges on Heroku, see Heroku Registry Documentation.
It is safer/better to work locally with non-root user ensuring the same container can run on Heroku.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...