Suse Linux docker file - docker

I have a suse linux 12 ec2 instance. I have activated a image sles11sp3-docker-image using sledocker. In the Dockerfile when I try to install ibm java 1.6 using
RUN zypper in java-1_6_0-ibm, I get following error .
Refreshing service 'container-suseconnect'.
Problem retrieving the repository index file for service 'container-suseconnect':
[|]
Skipping service 'container-suseconnect' because of the above error.
Warning: No repositories defined. Operating only with the installed resolvables. Nothing can be installed.
Loading repository data...
Reading installed packages...
'java-1_6_0-ibm' not found in package names. Trying capabilities.
Resolving package dependencies...
No provider of 'java-1_6_0-ibm' found.
Nothing to do.
The command '/bin/sh -c zypper in java-1_6_0-ibm' returned a non-zero code: 104
Please help

According to the docs (https://www.suse.com/documentation/sles-12/singlehtml/dockerquick/dockerquick.html), running zypper ref -s only gets you repo URLs with 12 hour tokens. Moreover, this command only appears to work while running in Docker on a SLES12 host.
Once I push the image to a repo and run it on another host, zypper ref -s no longer works (same error as yours). I'm basically stuck pre-installing all the base stuff before I publish the image.

Related

Composer Docker image won't run at all

I'm attempting to learn how to create a Laravel Docker image by following a tutorial on DigitalOcean using WSL. Following the instructions on the Docker Hub page, however, yields an error:
❯ docker run --rm --interactive --tty -v $(pwd):/app composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 94 installs, 0 updates, 0 removals
- Installing voku/portable-ascii (1.4.10): Failed to download voku/portable-ascii from dist: Could not delete /app/vendor/voku/portable-ascii/src/voku/helper:
Now trying to download from source
- Installing voku/portable-ascii (1.4.10):
[RuntimeException]
Could not delete /app/vendor/voku/portable-ascii/src/voku/helper:
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
How can I diagnose what I'm doing wrong?
It turns out that the underlying problem had nothing to do with Docker at all. In fact, Composer was trying to tell me what the problem was all along, but I dismissed it as just a symptom of a deeper issue:
[RuntimeException]
Could not delete /app/vendor/voku/portable-ascii/src/voku/helper:
This message was the crux of it all. I noticed that the directory mentioned, [...]/helper, was empty, so I tried to remove it by hand with rmdir. Instead, I got a No such file or directory error message. I attempted many other was to kill this directory, the entire project directory with rm -rf ~/laravel-app from the home folder, etc. Nothing worked.
Some digging around on the internet suggested that it could be an NTFS corruption if I was running into this issue on Windows. Since I am, indeed, attempting this on WSL (Windows Subsystem for Linux), I gave their suggested fix a try: running chkdsk /F in CMD/PowerShell. A reboot was necessary to complete this task, but after getting everything back up and trying those first few tutorial steps again, I was able to get composer to install the Laravel dependencies without a hitch.
Bottom line: If you run into this sort of issue on WSL, please try running chkdsk /F and reboot. You might just have a similar file system corruption.
We have two possibilities for this error:
1 - You did not execute the command inside the directory :
cd ~/laravel-app
2 - I'm sure there is an internal proxy that is blocking the download of packages.

Installing Informix CSDK in an Ubuntu Docker container

I'm trying to install ibm.csdk.4.50.FC3.LNX in a Docker container based on Ubuntu 18.
I run in the container the installation file as follows:
root#mycontainer:/usr/src/ibm.csdk.4.50.FC3.LNX# ./installclientsdk -i console
But I get this error:
One or more prerequisite system libraries are not installed on your
computer. Install libdl.so.2, libcrypt.so.1, libpam.so.0,
libstdc++.so.6, libm.so.6, libgcc_s.so.1, libc.so.6, libncurses.so.5
and then restart the IBM Informix installation program.
The installation cannot succeed until the minimum requirements are
met. For more information about the prerequisites, see your
Installation Guide or check with your System Administrator.
However those files are already in the container in the following paths:
/lib/x86_64-linux-gnu/libdl.so.2
/lib/x86_64-linux-gnu/libcrypt.so.1
/lib/x86_64-linux-gnu/libpam.so.0
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/lib/x86_64-linux-gnu/libm.so.6
/lib/x86_64-linux-gnu/libgcc_s.so.1
/lib/x86_64-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libncurses.so.5
How can I install it?
Running apt install unixodbc-dev seems fixing.
You might want to install also unixodbc
We have similar issue where we are running shell script which runs dbaccess inside the docker container. but as we run the docker as root user it is trying to use root user to connect to the informix db server. is there a way we can configure user name and password for dbaccess to use the configured userId instead of root.

pyodbc not working in web-service container, Azure Model Management

I am trying to create a web-service via Azure Model Management and am struggling.
I've followed the instructions and have managed to operationalize locally in a Docker container. My 'score.py' file includes a query to a SQL database using pyodbc. This functions perfectly when I test this on my local environment using the ML Workbench, however once this has been deployed in a Docker container I come across this error:
'Response Content': b'(\'01000\', "[01000] [unixODBC][Driver Manager]Can\'t open lib \'ODBC Driver 13 for SQL Server\' : file not found (0) (SQLDriverConnect)")'
I have included pyodbc in my conda_dependencies.yml.
Has anyone got any suggestions? Is there any further dependencies that I need to include?
Azure seem to have recently added the ability to customize container images using what they call a 'Docker Steps file'. I have practically no experience in Docker, but after reading this question i tried including a 'Docker Steps file' containing this:
ADD odbcinst.ini /etc/odbcinst.ini
RUN apt-get update
RUN apt-get install -y tdsodbc unixodbc-dev
RUN apt install unixodbc-bin -y
RUN apt-get clean -y
However i understand 'ADD' commands are not possible in this type of file, so this seems to have made no difference.
Hopefully this this all makes sense! Any advice would be very much appreciated! I hope I'm not the only one stumbling my way through Azure ML!
EDIT:
I'm still stuck, but making progress...
I accessed the root of the container using:
docker exec -ti -u root container_name bash
From here I ran 'odbcinst -j`, resulting in:
unixODBC 2.3.6
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
I couldn't seem to actually locate odbc.ini so i followed these instructions for installing 'ODBC Driver 13' for Ubuntu 16.04. Now when I run the service i get a different error:
{'Error': MlCliError({'Error': 'Error occurred while attempting to score service myapp.', 'Response Code': 502, 'Response Content': b'<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor="white">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.10.3 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n', 'Response Headers': {'Content-Length': '182', 'Content-Type': 'text/html', 'Date': 'Wed, 18 Apr 2018 14:06:30 GMT', 'Server': 'nginx/1.10.3 (Ubuntu)', 'Connection': 'keep-alive'}},), 'Azure-cli-ml Version': '0.1.0b2'}
I have also tried altering my score.py file to return: pyodbc.drivers() this results in a blank '[]'

Run Vagrant inside Docker container

I am looking for a way to run vagrant inside docker container. I tried using Ubuntu base container but had faced some issues while doing vagrant up, it failed.
root#991baf290ddc:/srv# vagrant up
VirtualBox is complaining that the installation is incomplete. Please
run VBoxManage --version to see the error message which should contain
instructions on how to fix this error.
root#991baf290ddc:/srv# VBoxManage --version
WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-dkms package and the appropriate headers, most likely linux-headers-.
You will not be able to start VMs until this problem is fixed.
5.0.40_Ubuntur115130
I tried installing virtualbox-dkms package but no help.
Deleting module version: 5.0.40 completely from the DKMS tree.
Done.
Loading new virtualbox-5.0.40 DKMS files...
dpkg: warning: version '*-*' has bad syntax: version number does not start with digit
dpkg: warning: version '3.10.0-514.16.1.el7.x86_64' has bad syntax: invalid character in revision number
It is likely that 3.10.0-514.16.1.el7.x86_64 belongs to a chroot's host
Building only for *
Building initial module for *
: using /lib/modules/4.4.0-83-generic/build/.config
(I hope this is the correct config for this kernel)
Done.
Error! The directory /lib/modules/* doesn't exist.
You cannot install a module onto a non-existant kernel.
The command '/bin/sh -c dpkg-reconfigure virtualbox-dkms' returned a non-zero code: 6
[root#test-docker vagrant-in-docker]#

Docker build from source fails

After git clone from dotcloud/docker
cd docker
sudo make VERBOSE=1
Fetching https://net/http/cookiejar?go-get=1
https fetch failed
**
unrecognized import path "net/http/cookiejar"
Can any one please tell me what should i be looking at. I have Go 1.1 installed. The reason i wanted to build docker from src it to remove sys_rawio from lxc.cap.drop. I needed to make CUDA work with lxc containers. I was able to compile cuda code but while running it. I keep getting driver related error that says Operation not permitted.
Installed Go from https://go.googlecode.com/files/go1.1.1.linux-amd64.tar.gz
As suggested by user creack in above comments.
cd docker/docker; go build; ./docker -d& ./docker version
I have docker build successfully now.
Docker can now be used to build docker and is the recommended (and only supported) method, see:
https://docs.docker.com/project/set-up-dev-env/

Resources