How do I install msodbcsql17 driver for alpine linux? - docker

I found a related issue on github but it is under the msphpsql repo so I'm not sure if it applies to the driver in general for alpine. It says MS does not support yet.
Official MS installation page has installation instructions only for Debian, RedHat, SUSE, Ubuntu.
If there are any workarounds, please suggest.
If this is not possible, please elaborate your answer as technically as possible. I could not find a suitable answer for this question anywhere.

This is the Dockerfile I've tested.
FROM alpine
# Install dependencies
RUN apk --no-cache add curl gnupg
# Download the desired package(s)
RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.6.1.1-1_amd64.apk
RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.6.1.1-1_amd64.apk
# (Optional) Verify signature, if 'gpg' is missing install it using 'apk add gnupg':
RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.6.1.1-1_amd64.sig
RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.6.1.1-1_amd64.sig
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --import -
RUN gpg --verify msodbcsql17_17.6.1.1-1_amd64.sig msodbcsql17_17.6.1.1-1_amd64.apk
RUN gpg --verify mssql-tools_17.6.1.1-1_amd64.sig mssql-tools_17.6.1.1-1_amd64.apk
# Install the package(s)
RUN apk add --allow-untrusted msodbcsql17_17.6.1.1-1_amd64.apk
RUN apk add --allow-untrusted mssql-tools_17.6.1.1-1_amd64.apk
and this is the log I got,
Sending build context to Docker daemon 2.174MB
Step 1/11 : FROM alpine
---> a24bb4013296
Step 2/11 : RUN apk --no-cache add curl gnupg
---> Running in d4f7b3b86157
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/32) Installing ca-certificates (20191127-r4)
(2/32) Installing nghttp2-libs (1.41.0-r0)
(3/32) Installing libcurl (7.69.1-r0)
(4/32) Installing curl (7.69.1-r0)
(5/32) Installing libgpg-error (1.37-r0)
(6/32) Installing libassuan (2.5.3-r0)
(7/32) Installing libcap (2.27-r0)
(8/32) Installing libffi (3.3-r2)
(9/32) Installing libintl (0.20.2-r0)
(10/32) Installing libblkid (2.35.2-r0)
(11/32) Installing libmount (2.35.2-r0)
(12/32) Installing pcre (8.44-r0)
(13/32) Installing glib (2.64.4-r0)
(14/32) Installing ncurses-terminfo-base (6.2_p20200523-r0)
(15/32) Installing ncurses-libs (6.2_p20200523-r0)
(16/32) Installing libgcrypt (1.8.5-r0)
(17/32) Installing libsecret (0.20.3-r0)
(18/32) Installing pinentry (1.1.0-r2)
Executing pinentry-1.1.0-r2.post-install
(19/32) Installing libbz2 (1.0.8-r1)
(20/32) Installing gmp (6.2.0-r0)
(21/32) Installing nettle (3.5.1-r1)
(22/32) Installing p11-kit (0.23.20-r5)
(23/32) Installing libtasn1 (4.16.0-r1)
(24/32) Installing libunistring (0.9.10-r0)
(25/32) Installing gnutls (3.6.14-r0)
(26/32) Installing libksba (1.4.0-r0)
(27/32) Installing db (5.3.28-r1)
(28/32) Installing libsasl (2.1.27-r6)
(29/32) Installing libldap (2.4.50-r0)
(30/32) Installing npth (1.6-r0)
(31/32) Installing sqlite-libs (3.32.1-r0)
(32/32) Installing gnupg (2.2.20-r0)
Executing busybox-1.31.1-r16.trigger
Executing ca-certificates-20191127-r4.trigger
OK: 27 MiB in 46 packages
Removing intermediate container d4f7b3b86157
---> f874be62c59e
Step 3/11 : RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.6.1.1-1_amd64.apk
---> Running in 264bf790ce99
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 923k 100 923k 0 0 21.9M 0 --:--:-- --:--:-- --:--:-- 21.9M
Removing intermediate container 264bf790ce99
---> cb999aaac06f
Step 4/11 : RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.6.1.1-1_amd64.apk
---> Running in 7fe887056e7e
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 304k 100 304k 0 0 8236k 0 --:--:-- --:--:-- --:--:-- 8236k
Removing intermediate container 7fe887056e7e
---> 07885ffff557
Step 5/11 : RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.6.1.1-1_amd64.sig
---> Running in efb39bbe31a7
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 481 100 481 0 0 17178 0 --:--:-- --:--:-- --:--:-- 17178
Removing intermediate container efb39bbe31a7
---> 0b47b4bdc30d
Step 6/11 : RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.6.1.1-1_amd64.sig
---> Running in 08a264662da9
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 481 100 481 0 0 16033 0 --:--:-- --:--:-- --:--:-- 16033
Removing intermediate container 08a264662da9
---> dad9d122c7ae
Step 7/11 : RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --import -
---> Running in ab82306e09cf
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 983 100 983 0 0 1386 0 --:--:-- --:--:-- --:--:-- 1386
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key EB3E94ADBE1229CF: public key "Microsoft (Release signing) <gpgsecurity#microsoft.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
Removing intermediate container ab82306e09cf
---> 3a524358b99f
Step 8/11 : RUN gpg --verify msodbcsql17_17.6.1.1-1_amd64.sig msodbcsql17_17.6.1.1-1_amd64.apk
---> Running in 0621d8db0ef8
gpg: Signature made Tue Jul 7 21:23:47 2020 UTC
gpg: using RSA key EB3E94ADBE1229CF
gpg: Good signature from "Microsoft (Release signing) <gpgsecurity#microsoft.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: BC52 8686 B50D 79E3 39D3 721C EB3E 94AD BE12 29CF
Removing intermediate container 0621d8db0ef8
---> 5e4b528817f0
Step 9/11 : RUN gpg --verify mssql-tools_17.6.1.1-1_amd64.sig mssql-tools_17.6.1.1-1_amd64.apk
---> Running in 8a51c0d21e7e
gpg: Signature made Mon Jul 6 18:59:24 2020 UTC
gpg: using RSA key EB3E94ADBE1229CF
gpg: Good signature from "Microsoft (Release signing) <gpgsecurity#microsoft.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: BC52 8686 B50D 79E3 39D3 721C EB3E 94AD BE12 29CF
Removing intermediate container 8a51c0d21e7e
---> a06ecc7c2031
Step 10/11 : RUN apk add --allow-untrusted msodbcsql17_17.6.1.1-1_amd64.apk
---> Running in 8f5c10bfb5ea
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/11) Installing krb5-conf (1.0-r2)
(2/11) Installing libcom_err (1.45.6-r0)
(3/11) Installing keyutils-libs (1.6.1-r1)
(4/11) Installing libverto (0.3.1-r1)
(5/11) Installing krb5-libs (1.18.2-r0)
(6/11) Installing libgcc (9.3.0-r2)
(7/11) Installing libstdc++ (9.3.0-r2)
(8/11) Installing openssl (1.1.1g-r0)
(9/11) Installing readline (8.0.4-r0)
(10/11) Installing unixodbc (2.3.7-r2)
(11/11) Installing msodbcsql17 (17.6.1.1)
Executing msodbcsql17-17.6.1.1.pre-install
Using this product constitutes agreement with the
End User License, which can be downloaded from
https://aka.ms/odbc17eula and found in
/usr/share/doc/msodbcsql17/LICENSE.txt .
If you do not agree with the terms, please uninstall
the product by typing 'apk del msodbcsql17'
Executing msodbcsql17-17.6.1.1.post-install
Executing busybox-1.31.1-r16.trigger
OK: 186 MiB in 57 packages
Removing intermediate container 8f5c10bfb5ea
---> 3e449c097c43
Step 11/11 : RUN apk add --allow-untrusted mssql-tools_17.6.1.1-1_amd64.apk
---> Running in 889ede754d73
(1/1) Installing mssql-tools (17.6.1.1)
Executing mssql-tools-17.6.1.1.pre-install
Using this product constitutes agreement with the
End User License, which can be downloaded from
http://go.microsoft.com/fwlink/?LinkId=746949 and found in
/usr/share/doc/mssql-tools/LICENSE.txt .
If you do not agree with the terms, please uninstall
the product by typing 'apk del mssql-tools'
OK: 340 MiB in 58 packages
Removing intermediate container 889ede754d73
---> 0141e9b50f20
Successfully built 0141e9b50f20
Successfully tagged microsoft_odbc_17_alpine:latest
I hope this will solve you problem. You can find all the versions such as Alpine Linux, Debian, Red Hat Enterprise Server and Oracle Linux, SUSE Linux Enterprise Server and Ubuntu as well as you can also find Previous versions installation details from Install the Microsoft ODBC driver for SQL Server (Linux) article.

Related

I am trying to install docker on centos8 vagrantbox facing the error 'Downloading successful, but checksum doesn't match'

[MIRROR] containerd.io-1.2.0-3.el7.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: ece851b2b2defa24eb3b817b14d97f31f4043a713d7367972bd2c1ef4f2788b8(sha256) Expected: 7bd1d8da7d896ead55fdea3a42100eac4c4d7800f958d3ae056d40268dec4636(sha256)
(8/21): python3-policycoreutils-2.9-9.el8.noarch.rpm 107 kB/s | 2.2 MB 00:21
[MIRROR] containerd.io-1.2.0-3.el7.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: 3928fc6c58817b02602a249e512d7e99b7c3fe06ea5d9ff3ad46e25984ff8141(sha256) Expected: 7bd1d8da7d896ead55fdea3a42100eac4c4d7800f958d3ae056d40268dec4636(sha256)
[MIRROR] docker-ce-18.09.1-3.el7.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: 3ddabd445a05b85aeba128da42283d3285ca8055e6a201139ee49b682942ba43(sha256) Expected: 6034f83c3bf3d5d31120ef36b3172dbb28d1ac8ae3699ed8cb33924dcef0d17a(sha256)
[MIRROR] containerd.io-1.2.0-3.el7.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: 3914815a5c9756672d6f046929335ddff86607c29ac8a3c3fc12452a69952bf7(sha256) Expected: 7bd1d8da7d896ead55fdea3a42100eac4c4d7800f958d3ae056d40268dec4636(sha256)
[FAILED] containerd.io-1.2.0-3.el7.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success
(10-11/21): docker-ce-18.09.1-3.el7.x86_64.rpm 50% [============================================== ] 1.4 MB/s | 50 MB 00:35 ETA
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'yum clean packages'.
Error: Error downloading packages:
Cannot download Packages/containerd.io-1.2.0-3.el7.x86_64.rpm: All mirrors were tried
Error: Transaction test error: package selinux-policy-targeted-3.14.3-41.el8_2.5.noarch does not verify: Header SHA1 digest: BAD (Expected ab8b3fe6b75faa65c89e64ec34986ee49924f982 != 3716bcc257255e43bc9ace1b9c4aecb6fcba3e61) package python3-policycoreutils-2.9-9.el8.noarch does not verify: Header SHA1 digest: BAD (Expected af32d12b99154706740619e0ac39289c009f1aa9 != faa84ee41c25523f2a05358d172f124370c18f99) package containerd.io-1.2.6-3.3.el7.x86_64 does not verify: no digest
''' Please help me to install docker on centos8 to fix this issue SHA1 digest: BAD '''
Try installing packages containerd manually:
yum clean packages #clean packages from failed install
dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm #install newest containerd manually
sudo yum install docker-ce docker-ce-cli #install Docker daemon and CLI
Links:
Install Docker on CentOS
Docker documentation for installation
on CentOS
Docker CentOS repository

ERROR: Exhausted all sources trying to fetch version 'latest' of RVM

I am configuring CentOS 6 Server. i am trying to install rvm but i am getting error. when i try to install rvm in server. Can anyone knows the reason?
step1.
gpg --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
OUTPUT
gpg: key D39DC0E3: "Michal Papis (RVM signing) <mpapis#gmail.com>" not changed
gpg: key D39DC0E3: "Totally Legit Signing Key <mallory#example.org>" not changed
gpg: key 39499BDB: "Piotr Kuczynski <piotr.kuczynski#gmail.com>" not changed
gpg: Total number processed: 3
gpg: unchanged: 3
step 2 (where i get error)
curl -sSL https://get.rvm.io | bash -s stable
Output
WARN: ...the preceeding error with code 35 occurred while fetching https://api.github.com/repos/rvm/rvm/tags
curl: (35) SSL connect error
WARN: ...the preceeding error with code 35 occurred while fetching https://api.bitbucket.org/2.0/repositories/mpapis/rvm/refs/tags?sort=-name&pagelen=20
ERROR: Exhausted all sources trying to fetch version 'latest' of RVM!
What is the version of cURL in your server?
This might shed some light: cURL SSL connect error 35 with NSS error -5961

Docker Build: Missing Dependency

When my Docker build reaches this part of the Dockerfile:
ARG cabal=1.22.9.0
RUN curl -L http://hackage.haskell.org/package/cabal-install-${cabal}/cabal-install-${cabal}.tar.gz | tar -xzf- && \
cd cabal-install-${cabal} && \
EXTRA_CONFIGURE_OPTS= ./bootstrap.sh --global
It eventually ends with this error.
Downloading zlib-0.6.1.1...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 139k 0 139k 0 0 293k 0 --:--:-- --:--:-- --:--:-- 293k
[1 of 1] Compiling Main ( Setup.hs, Setup.o )
Linking Setup ...
Configuring zlib-0.6.1.1...
Setup: Missing dependency on a foreign library:
* Missing (or bad) header file: zlib.h
* Missing C library: z
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
Error during cabal-install bootstrap:
Configuring the zlib package failed.
The command '/bin/sh -c curl -L http://hackage.haskell.org/package/cabal-install-${cabal}/cabal-install-${cabal}.tar.gz | tar -xzf- && cd cabal-install-${cabal} && EXTRA_CONFIGURE_OPTS= ./bootstrap.sh --global' returned a non-zero code: 2
Is there something I can include in my Dockerfile that can prevent this?

error when install tools in docker container

I install ubuntu-14.04.4-server-amd64.iso in my VirtualBox,then I use some way to get its rootfs. after that i can the rootfs to create my docker image.the Dockerfile as following:
FROM scratch
COPY rootfs /
RUN chmod u+s /usr/bin/sudo && chmod u+s /bin/mount && chmod u+s /bin/umount
I start my docker container,then I install some tools,like minicom,wget ...,but error,the following is error msg:
root#20ca319c51e6:~$ apt-get install minicom
Reading package lists... Done
Building dependency tree
Reading state information... Done
minicom is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up libpam-systemd:amd64 (204-5ubuntu20.19) ...
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
invoke-rc.d: unknown initscript, /etc/init.d/systemd-logind not found.
runlevel:/var/run/utmp: No such file or directory
dpkg: error processing package libpam-systemd:amd64 (--configure):
subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
libpam-systemd:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
I also try to "apt-get update;apt-get upgrade",but get same error msg too,
what's should i do.need you help! thanks all :)

Ruby installation exited with Error running 'requirements_osx_port_update_system ruby-2.0.0-p247',

I was installing ruby on my mac with os x 10.8.5 using following command:
$ \curl -L https://get.rvm.io | bash -s stable --ruby
and all of sudden I got following errors:
Error running 'requirements_osx_port_update_system ruby-2.0.0-p247',
please read /Users/home/.rvm/log/1380202439_ruby-2.0.0-p247/update_system.log
Requirements installation failed with status: 1.
and this is the content of log file:
[2013-09-26 17:03:59] requirements_osx_port_update_system
requirements_osx_port_update_system () {
__rvm_try_sudo port -dv selfupdate || return $? } current path: /Users/home/.rvm/src/rvm command(2):
requirements_osx_port_update_system ruby-2.0.0-p247 DEBUG: Copying
/Users/home/Library/Preferences/com.apple.dt.Xcode.plist to
/opt/local/var/macports/home/Library/Preferences DEBUG: MacPorts
sources location:
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs
---> Updating MacPorts base sources using rsync receiving file list ... done base.tar
sent 13396 bytes received 10185 bytes 3627.85 bytes/sec total size
is 4925440 speedup is 208.87 receiving file list ... done
base.tar.rmd160
sent 64 bytes received 635 bytes 199.71 bytes/sec total size is 512
speedup is 0.73 DEBUG: successful verification with key
/opt/local/share/macports/macports-pubkey.pem DEBUG: /usr/bin/tar -C
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/tmp
-xf /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base.tar
MacPorts base version 2.1.3 installed, DEBUG: Rebuilding and
reinstalling MacPorts if needed MacPorts base version 2.2.0
downloaded.
---> Updating the ports tree Synchronizing local ports tree from rsync://rsync.macports.org/release/tarballs/ports.tar DEBUG:
/usr/bin/rsync -rtzv --delete-after
rsync://rsync.macports.org/release/tarballs/ports.tar
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs
receiving file list ... done ports.tar
sent 51725 bytes received 31635 bytes 11114.67 bytes/sec total size
is 54435840 speedup is 653.02 DEBUG: /usr/bin/rsync -rtzv
--delete-after rsync://rsync.macports.org/release/tarballs/ports.tar.rmd160
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs
receiving file list ... done ports.tar.rmd160
sent 64 bytes received 636 bytes 155.56 bytes/sec total size is 512
speedup is 0.73 DEBUG: successful verification with key
/opt/local/share/macports/macports-pubkey.pem DEBUG: /usr/bin/tar -C
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/tmp
-xf /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports.tar
DEBUG: /usr/bin/rsync -rtzv --delete-after
rsync://rsync.macports.org/release/tarballs/PortIndex_darwin_12_i386/PortIndex
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs
receiving file list ... done PortIndex
"~/.rvm/log/1380202439_ruby-2.0.0-p247/update_system.log" 176L, 8429C
You should uninstall macports... homebrew and macports don't mix well. issue the command from the terminal:
$ sudo port -fp uninstall installed
http://guide.macports.org/chunked/installing.macports.uninstalling.html
You may also need to clean up homebrew
$ brew cleanup
Then you should be able to install via homebrew.

Resources