I am creating a recipe to install docker on Ubuntu 14.
How do I translate the command above to chef?}
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
So using apt-repository resource:
apt_repository "???" do
uri ???
distribution ???
components ???
keyserver "hkp://p80.pool.sks-keyservers.net:80"
key "58118E89F3A912897C070ADBF76221572C52609D"
end
In contrast to #kaboom, I would recommend the (more modern) apt cookbook maintained by Chef, which also allows to set up repos. The syntax is basically the same.
This is, how I install Docker (on Debian):
apt_repository "docker" do
uri "https://apt.dockerproject.org/repo"
distribution "#{node['platform']}-#{node['lsb']['codename']}"
components ["main"]
key "https://apt.dockerproject.org/gpg"
end
EDIT: This is also available in Chef core without any cookbook as of 12.9.
EDIT2: Of course, you can also supply the keyserver and key_id parameters, if you want to specify it as such.
Related
I'm currently working out a Dockerfile. So I am trying to build out a Centos 7.6 base image and I get a failure when I try to use any yum packages. I'm not sure what the cause of this is.
I've already attempted to make the user root to see if that makes a difference but it doesn't help the situation. I've also done a docker pull centos to recieve the latest version of centos.
I simplified the code and still the same error.
FROM centos
ARG MONGO-RAILS-VERSION="0.0"
RUN yum install vim
# curl -L get.rvm.io | bash -s stable \
# rvm install 2.3.1 \
# rvm use 2.3.1 --default \
# gem install rails
I get an error that looks something like this
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
14: curl#7 - "Failed to connect to 2001:1b48:203::4:10: Network is unreachable"
The command '/bin/sh -c yum install vim' returned a non-zero code: 1
You may want to have a look for Set build-time variables (--build-arg):
$ docker build --build-arg HTTP_PROXY=http://10.20.30.2:1234 --build-arg FTP_PROXY=http://40.50.60.5:4567 .
I am trying to install ruby gems on my computer running Ubuntu 16.04. I use bash with the oh-my-zsh framework.
When I run the command:
curl -L https://get.rvm.io | bash -s stable --ruby
I get the error message:
mktemp: failed to create file via template '/usr/share/rvm/rvm-exec-test.XXXXXX': Permission denied
How do I set up the permissions for this to work properly?
You can use:
curl -L https://get.rvm.io | sudo bash -s stable --ruby
NOTE: Running a script as sudo can be very dangerous if you don't know what it is actually doing. Make sure to check the script and if possible give the appropriate permissions to the required files and or folders it needs to access. For some more info regarding why it can be dangerous see https://elementaryos.stackexchange.com/questions/448/why-is-running-commands-with-sudo-dangerous
Quick example with your particular use case, as can be seen in the link:
"...If a website is asking you to curl http://link/to/script | sudo bash, don't do that. Download the script, take a quick look, and after that, you can run it. Even if the original author did not intend to make the script malicious, someone might have compromised the original author's accounts and uploaded a new, "updated" script. You are the one responsible for your computer's integrity, and therefore you need to be familiar with your system's capabilities."
Make The directory as read and write ... cd dirname chmod 777
or
sudo gem install 'gem name','version'
completely new to 'Docker', wondered what this means in installation instructions. https://docs.docker.com/engine/installation/linux/ubuntulinux/
4/ Add the new GPG key.
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 -- recv-keys 58118E89F3A912897C070ADBF76221572C52609D
This is part of the SecureApt (strong crypto to validate downloaded packages)
apt-key is a program that is used to manage a keyring of gpg keys for secure apt.
gpg is the tool used in secure apt to sign files and check their signatures
That works... if the key server is up (see issue 13555, and "Key server times out while installing docker on Ubuntu 14.04")
The pool hkp://p80.pool.sks-keyservers.net is a subset of servers which are also available on port 80. It's more friendly to firewalls and companies.
For some reason, most docker documentations and tutorials are giving that p80 pool for installation, without further explanation.
The thing is, this is a small pool of servers and they fail very often in practice. (The fact that most tutorials are sending people to that small pool probably doesn't help either).
All Rails applications are working just fine until today. I am not sure if someone changes the settings on this machine. However does anyone know what could be the fix for this?
Details:
Centos 5.5
Apache
Passenger
Rails 3.0.x
MySql 5.0.77
Error details:
Okay this saves the day.
wget -O /usr/lib64/libmysqlclient.so.15 http://files.directadmin.com/services/es_5.0_64/libmysqlclient.so.15
chmod 755 /usr/lib64/libmysqlclient.so.15
ldconfig
You can try to find the right package by the following command:
$ sudo yum whatprovides libmysqlclient.so.15
libmysqlclient15-5.0.95-5.w5.i386
libmysqlclient15-devel-5.0.95-5.w5.i386
cpanel-mysql-libs-5.0.96-1.cp1136.i386 : The shared libraries required for MySQL clients
then:
$ sudo yum reinstall WHATEVER_THE_PACKAGE_NAME_IS
You may double check the package name by doing yum search package_name.
If not found, you may try to fix your yum repositories e.g. by configuring Webtatic Yum Repository.
To set up the repository, install the webtatic-release RPM:
Webtatic EL6 for CentOS/RHEL 6:
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
Webtatic EL5.1 for CentOS/RHEL 5:
rpm -Uvh http://repo.webtatic.com/yum/el5/latest.rpm
Webtatic 5 for CentOS/RHEL 5:
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
and repeat the search/reinstall process again.
If you're running cPanel, you may try to run the following script:
/scripts/check_cpanel_rpms --fix
If won't help, remove the broken package e.g. rpm -e cpanel-mysql-5.0.96-1.cp1136 and run the check command again.
If still doesn't work, another thing could be to recompile your Apache (only if your LAMP is broken) by:
/scripts/easyapache
I am currently attempting to install RVM on an Ubuntu server using version 8.04.4.
At the moment I am a attempting a single user install. I am the only person who administers this machine and I am still pretty noobish at this. I am currently following he installations guide on the RVM site and added the 'k' flag to the curl command. The complaints about the certificate still do not go away.
$ bash -s stable < <(curl -sk https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Downloading RVM from wayneeseguin branch stable
curl: (77) error setting certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
Could not download 'https://github.com/wayneeseguin/rvm/tarball/stable'.
curl returned status '77'.
My ultimate goal is merely to upgrade ruby from v1.8.6 to 1.9.2 on this machine.
I've noticed many people recommending against a multi-user installation which is why I have yet to attempt it. Is it recommended that I try a multi-user installation? If not can someone assist me in eradicating this certificate issue?
Thanks in advance.
Do it single user. Your problem isn't RVM though -- it's the CA certs.
Read this link and make sure your SSL is up to date, and you have installed the CA certs:
https://help.ubuntu.com/community/OpenSSL
To install ca certs on Ubuntu using apt:
apt-get install ca-certificates
according to man curl this problem is:
77 Problem with reading the SSL CA cert (path? access rights?).
I guess you have sissues with access rights to the mentioned file:
/etc/ssl/certs/ca-certificates.crt
make sure is readable for all users:
sudo chmod 755 /etc/ /etc/ssl/ /etc/ssl/certs/
sudo chmod 644 /etc/ssl/certs/ca-certificates.crt