Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

testing - Alpine Docker ERROR: Unable to lock database: Permission denied ERROR: Failed to open apk database: Permission denied

So I have used the default docker for testcafe which on docker hub is testcafe/testcafe and I have to run a few testcafe scripts.

However, I need the screenshot that fires on error, to be uploaded to somewhere where I can look at it later after the docker image is done running.

I am using the Imgur program which uses bash so I re-did a few things to make it sh compatible and everything works except I need curl. I tried running

apk add curl

but I'm getting the error

ERROR: Unable to lock database: Permission denied ERROR: Failed to open apk database: 

Now I no this means that I do not have permission to do this but can I get around this is there some way to become root (this is in bitbucket pipeline).

I do NOT really want to create my own docker.

Also note all questions I have found relating to this are about installing while creating the docker, however, my question is how to do this after the docker is created. thx (a fine answer would be another way to save the screen shot, but preferably not with ssh).

question from:https://stackoverflow.com/questions/50727783/alpine-docker-error-unable-to-lock-database-permission-denied-error-failed-to

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

1 Reply

0 votes
by (71.8m points)

For those seeing this error using a Dockerfile (and coming here via a Google search): add the following line to your Dockerfile:

USER root

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...