I am writing a custom buildpack that downloads a file and stores it inside /var/lib/myfolder
To do this I first run mkdir -p /var/lib/myfolder
But this results in a Permission Denied when running the buildpack.
How can I solve this?
Only the /app folder will be stored at the end of your build, and your buildpack doesn't have sudo access.
You need to store all files inside that folder, and configure your libraries to use dependencies under the right path there.
Related
i'm using logstash image and i have some ruby scripts that are located in the same directory as my dockerfile.
my goal is to create a script folder, and copy my scripts to it.
my problem is that when i access to the container instance, the folder is not created and no ruby file exist.
this is my dockerfile
FROM docker.elastic.co/logstash/logstash:${ELK_VERSION}
USER root
WORKDIR /usr/share/logstash
RUN mkdir scripts
COPY ./scripts/*.rb scripts
thanks in advance.
EDIT 1:
this is the files structure
I am trying to send war file built in Java Web application to AWS EC2 instance. Here is the command which I have far used for sending war file.
cd/ usr/share/tomcat8/webapps/
As I have my previous war file in this folder. After that I have use command ls from which something like this come
com.metokart com.metokart.war host-manager manager ROOT ROOT-OLD-1
At this .war is the previous one, First I have rename the folder ROOT to another name using this command-
sudo mv ROOT ROOT-OLD-6
After that I have deleted both the .war file and com.metokart folder from the webapps
sudo rm -rf com.metokart.war
sudo rm -rf com.metokart
Then I have gone to default directory to upload the new war file
sudo cp -i com.metokart.war /usr/share/tomcat8/webapps/
After that I have change the ROOT folder name back to ROOT.
sudo mv ROOT-OLD-6 ROOT
At last I have restarted my tomcat
sudo services tomcat8 restart
But still I don't know where I am doing the mistake. Hope anyone can help.
You should use pscp from within putty. Here is a helpful link that should guide you https://it.cornell.edu/managed-servers/transfer-files-using-putty.
I'm trying to compress an image on Lambda using mozjpeg, but am having some issues.
The binary doesn't have execute permissions, and so I'm getting this error:
"exports._errnoException (util.js:870:11)",
"ChildProcess.spawn (internal/child_process.js:298:11)",
"Object.exports.spawn (child_process.js:362:9)",
"ret.catch.module.exports.promise (/var/task/node_modules/imagemin-mozjpeg/node_modules/exec-buffer/node_modules/execa/index.js:132:26)",
"/var/task/node_modules/imagemin-mozjpeg/node_modules/exec-buffer/index.js:36:15"
When I try to fix the permissions, I get this error:
'chmod: changing permissions of ‘/var/task/node_modules/imagemin-mozjpeg/node_modules/mozjpeg/vendor/cjpeg’: Read-only file system\n'
Is there a way to get the binaries to execute within node_modules, or an alternative to executing them manually from the tmp dir without the benefit of their nodejs wrappers?
You need to ensure that the method you use to zip your files includes preserving or setting the execute permissions in Unix format. They will then be preserved when the file is unzipped from S3.
It's my first time deploying something to AWS using Elastic Beanstalk and so far I've gotten to the point where I can run eb create and get started. The first time I did this I got Errno 13. Specifically, I got to the point where it tried to create the application and then:
Creating application version archive "app-150423_212419".
ERROR: IOError :: [Errno 13] Permission denied: './.viminfo'
I learned that this is a root access issue and so I followed a step found here that stated I should try the bash command:
sudo chown -R test /home/test
Here test = my user name and home = Users.
This got me to the error ERROR: OSError :: [Errno 2] No such file or directory: './.collab/ext'
I'm really not sure what that directory is supposed to be or why it's trying to access it. How can I choose a proper directory so that I can get things up and running?
eb create will attempt to zip up your entire directory and deploy it to an elastic beanstalk environment. I am not sure why certain files seem to not exist(maybe you have some symlinks?).
It also looks as if you might be trying to run eb create in your home directory. Dont do that. In fact remove the .elasticbeanstalk folder from your home directory right now.
All you need to do is go into your project directory, run eb init, then eb create.
Anyone know why I would get this error when trying to create a grails app using terminal.
mycomputer:test-apps mailboxe$ grails create-app demo
| Configuring classpath
| Error Error executing script CreateApp: /Users/bla/.grails/ivy-cache/resolved-org.grails.internal-grails-2.0.3.xml (Permission denied) (Use --stacktrace to see the full trace)
As #Phillip Tenn mentions, this is a permissions issue. Chances are something got installed into a cache with the sudo command so the root user owns the file and your normal user can't modify it.
The easiest thing to do is probably to just whack your ~/.grails directory, by default, there isn't anything but cached information in there. So unless you've put something in there manually (like a config file), it's safe to delete and let it regenerate with the next grails command. To do that, just:
cd ~
sudo rm -r .grails
It'll prompt you for your password to ensure you want to run this command as the root user.
Alternatively, you could try to find the offending file and chown it to your user and group (by default on OSX the group is staff). So for this example:
sudo chown bla:staff /Users/bla/.grails/ivy-cache/resolved-org.grails.internal-grails-2.0.3.xml
Grails needs to be able to write to a .grails folder under your user directory.
Without knowing the details of your development environment, the error message you are getting says (Permission denied) when you try to run grails create-app demo.
I would look into your directories:
/Users/bla/.grails/
/Users/bla/.grails/ivy-cache/
and ensure that you have proper write permissions.