docker removed, but is still updating - docker

I used docker for a while, but i don't need it anmyore. So i removed it from my Ubuntu 16.04. When i try "sudo apt-get remove docker" it says that there is nothing, but when i run "sudo apt-get update" i get many lines like this:
Ign:45 https://download.docker.com/linux/ubuntu ยง(lsb_release/stable amd64 DEP-11 Metadata
So it's still updating docker.
Does anyone know how to remove docker completely from Ubuntu 16.04?

As sanath already stated you still have entries in /etc/apt/source.list for the docker package repository. You need to remove these (look for lines containing docker in that file and remove them).
To explain what these entries are:
/etc/apt/sorce.list lists all sources for packages which you can install/upgrade using apt. When you followed the steps in the installation of docker you added a line with the address of the docker package repository there. Now apt update always polls that repo to check if it contains any upgrades of a package you have installed.
Now because that address contains docker you falsely asume that you still have docker installed, which is not the case. Docker is simply part of the url of one of the repositories that is queried for updates.

It's because some of the entries are still present in.
nano /etc/apt/source.list
Remove lines which is having docker repository.
Then do apt-get update

Related

Centos image build fails when I use rpms via docker

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 .

Ubuntu, shopsys install via composer, docker, still crashing

I wanna install shopsys via composer and docker, as is recommended.
https://github.com/shopsys/shopsys/blob/master/docs/installation/installation-using-docker-linux.md
I installed git, php-fpm (configured), postgres (configured), composer, docker, docker-compose.
sudo apt install git
sudo apt install php7.2-fpm
sudo apt install postgresql
sudo apt install composer
sudo apt install docker-ce
sudo apt install docker-compose
Everything ok.
I added my user to docker group.
sudo usermod -a -G docker $(whoami)
Ok.
Next I made folder /var/www/html/shopsys, created project shopsys via composer.
composer create-project shopsys/project-base --no-install --keep-vcs
cd project-base/
Then I run this in /var/www/html/shopsys/project-base.
./scripts/install.sh
Everything seems to be ok, until this.
[RuntimeException]
/var/www/html/vendor does not exist and could not be created.
I set rights to 777 for folder /var/www/html, and run it again, but same problem.
The I run this.
sudo composer install
It shows me this error.
....Exception\InvalidConfigurationException]
Invalid configuration for path "monolog.handlers.main": You can only use ex
cluded_http_codes/excluded_404s with a FingersCrossedHandler definition
In ScriptHandler.php line 294:
An error occurred when executing the "'shopsys:domains-urls:configure'" command:
In BaseNode.php line 319:
...\Exception\InvalidConfigurationException]
Invalid configuration for path "monolog.handlers.main": You can only use ex
cluded_http_codes/excluded_404s with a FingersCrossedHandler definition
...
etc., error is quite ugly.
Last error when i run script install.sh.
file_put_contents(/var/www/html/vendor/composer/installed.json): failed to open stream: Permission denied
But this folder does not exist.
ls: cannot access '/var/www/html/vendor/': No such file or directory
Just question, where could be the problem?
Is possible to download sources from some link, extract it, configure and display in web browser with easy way, for example as wordpress?
Thanks.
To solve problem with vendor:
It seems that your UID and GID is different than default 1000, that is set in docker-compose.yml for Linux by default.
To solve your issue you can continue by step 3 in https://github.com/shopsys/shopsys/blob/master/docs/installation/installation-using-docker-linux.md#3-set-the-uid-and-gid-to-allow-file-access-in-mounted-volumes
You found issue with installation script, I have created issue on GitHub.
To solve problem with Invalid configuration for path "monolog.handlers.main":
Currently there is problem with new minor version (3.4.0) of symfony/monolog-bundle that created BC break. There is already created issue about this problem and there is already merged fix in Shopsys master.
To solve problem in your project you have to add
"symfony/monolog-bundle": ">=3.4.0", in conflict section in your composer.json file and then run composer install again.
We are trying to answer questions on stackoverflow as soon as possible, but we also have Slack where is many users and you might get your question answered much faster.

Docker specific installation version. Dependency failed

Needed a specific version of docker (18.06.1-ce). Removed newer version. Followed: http://www.devopsage.com/how-to-install-docker-on-ubuntu-16-04/ to install.
(ubuntu-16-04)
In the end, systemctl status docker.service got an exception like this:
Dependency failed for Docker Application Container Engine.
Already spent some time googling. No luck.
Q: How it could be fixed?
Thanks.
OK.
Maybe it will save time for someone. The key was to remove previous version like with this command. (Seems something stuck unremoved that caused that issue). Removed again, followed the steps, all started being Ok. again.
To remove:
sudo apt-get remove docker docker-engine docker-ce docker.io
Before I did:
sudo apt-get remove docker docker-ce. // not good

Setup Docker Jenkins with default plugins

I want to create a Jenkins based image to have some plugins installed as well as npm. To do so I have the following Dockerfile:
FROM jenkins:2.60.3
RUN install-plugins.sh bitbucket
USER root
RUN apt-get update
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs
RUN npm --version
USER jenkins
That works fine however when I run the image I have two problems:
It seems that the plugins I tried to install manually didn't get persisted for some reason.
I get prompted the list of plugins I want to install but I don't want to install anything else.
Am I missing anything configuring the Dockerfile or is it that what I want to achieve is simply not possible?
Without seeing the contents of install-plugins.sh, I can't comment as to why the plugins aren't persisting. It is most likely caused by an incorrect installation destination; persistence shouldn't be an issue at this stage, since the plugin installation is built into the image itself.
As for the latter issue, you should be able to skip the installation wizard altogether by adding the line ENV JAVA_OPTS=-Djenkins.install.runSetupWizard=false
to your Dockerfile. Please note that this can be a security risk, if the Jenkins image is exposed to the world at large, since this option disables the need for authentication
EDIT: The default plugin directory for the Docker image is /var/jenkins_home/plugins
EDIT 2: According to the README on the Jenkins Docker repo, adding the line RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.stateshould accomplish the same thing
Things have changed since 2017, when the last answer was posted, and it no longer works. The current way is in following Dockerfile snippet:
# Prevent setup wizard from running.
# WARNING: Jenkins will start with security disabled, without any password.
ENV JENKINS_OPTS="-Djenkins.install.runSetupWizard=false"
# plugins.txt must contain the list of plugins to be installed
# (One plugin per line, e.g. sidebar-link:1.11.0)
COPY plugins.txt /tmp/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /tmp/plugins.txt

What's the difference when installing docker with 2 of these following command?

When it comes to install Docker on centos, i found 2 different ways to do it.
The first one is : yum install docker-engine
The second one is: yum install docker-io
And in case i installed docker using the first one, it i continue with the second one the error appeared, like this:
Error: docker-engine conflicts with docker-1.8.2-10.el7.centos.x86_64
Error: docker-engine-selinux conflicts with docker-selinux-1.8.2-10.el7.centos.x86_64
So anyone can tell me what's the difference between them?
This dates back from June 2015, when Docker announced "New Apt and Yum Repos"
That is when new packages (like the one for CentOS) were named docker-engine (initially to replace lxc-docker*)

Resources