[DOCKER] Comment utiliser mssql-tools avec Alpine

Lorsque je réduisais la taille de Docker Image au travail, j'étais en difficulté car mssql-tools ne pouvait pas être installé avec alpine. En enquêtant sur la méthode, il y avait une personne qui a donné une solution à Git, alors j'y ai fait référence et l'ai résolue. Laissez la procédure à ce moment-là sous forme de mémorandum.

Le forfait n'est pas officiellement offert

https://packages.microsoft.com/config/ スクリーンショット 2020-11-06 10.18.42.png

Faire le tour

Il n'est pas fermé pour le moment (2020/11/6) sur problèmes github, mais [Installez le pilote Microsoft ODBC pour SQL Server ( Linux)](https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server- Il existe un exemple en 2017 # alpine-linux), veuillez donc vous y référer. スクリーンショット 2020-11-06 10.27.18.png

Qu'est-il arrivé après tout

Au fur et à mesure que vous lisez les problèmes, dbamaster a publié un échantillon de DockerFile sur github! Agréable https://github.com/dbamaster/mssql-tools-alpine スクリーンショット 2020-11-06 10.29.43.png

J'ai utilisé la partie de commande d'installation suivante comme référence pour mon fichier Docker.

Extrait de la partie commande installée
# Installing system utilities
RUN apk add --no-cache curl gnupg --virtual .build-dependencies -- && \
    # Adding custom MS repository for mssql-tools and msodbcsql
    curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_${MSSQL_VERSION}_amd64.apk && \
    curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_${MSSQL_VERSION}_amd64.apk && \
    # Verifying signature
    curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_${MSSQL_VERSION}_amd64.sig && \
    curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_${MSSQL_VERSION}_amd64.sig && \
    # Importing gpg key
    curl https://packages.microsoft.com/keys/microsoft.asc  | gpg --import - && \
    gpg --verify msodbcsql17_${MSSQL_VERSION}_amd64.sig msodbcsql17_${MSSQL_VERSION}_amd64.apk && \
    gpg --verify mssql-tools_${MSSQL_VERSION}_amd64.sig mssql-tools_${MSSQL_VERSION}_amd64.apk && \
    # Installing packages
    echo y | apk add --allow-untrusted msodbcsql17_${MSSQL_VERSION}_amd64.apk mssql-tools_${MSSQL_VERSION}_amd64.apk && \
    # Deleting packages
    apk del .build-dependencies && rm -f msodbcsql*.sig mssql-tools*.apk

la fin

Recommended Posts

Comment utiliser mssql-tools avec Alpine
Comment utiliser BootStrap avec Play Framework
Comment utiliser Map
Comment utiliser rbenv
Comment utiliser with_option
Comment utiliser fields_for
Comment utiliser java.util.logging
Comment utiliser la carte
Comment utiliser collection_select
Comment utiliser Twitter4J
Comment utiliser MapStruct
Comment utiliser TreeSet
[Comment utiliser l'étiquette]
Comment utiliser l'identité
Comment utiliser le hachage
Comment utiliser Dozer.mapper
Comment utiliser Gradle
Comment utiliser org.immutables
Comment utiliser java.util.stream.Collector
Comment utiliser VisualVM
Comment utiliser Map
Comment utiliser h2db intégré avec Spring Boot
Comment utiliser l'API Java avec des expressions lambda
Comment utiliser le protocole NFS version 2 avec Ubuntu 18.04
Comment utiliser l'API Chain
[Java] Comment utiliser Map
Comment utiliser Queue avec priorité
[Rails] Comment utiliser enum
Comment utiliser java Facultatif
Comment utiliser le retour Ruby
[Rails] Comment utiliser enum
Comment utiliser @Builder (Lombok)
Comment utiliser la classe Java
[Java] Comment utiliser removeAll ()
Comment utiliser la jonction de rails
Comment numéroter (nombre) avec html.erb
Comment utiliser Java Map
Comment mettre à jour avec activerecord-import
Ruby: Comment utiliser les cookies
Comment utiliser Dependant :: Destroy
Comment utiliser Eclipse Debug_Shell
Comment utiliser Apache POI
[Rails] Comment utiliser la validation
Comment utiliser les variables Java
[Rails] Comment utiliser authenticate_user!
Comment utiliser GC Viewer
Comment utiliser Lombok maintenant
[Création] Comment utiliser JUnit
[Rails] Comment utiliser Scope