diff --git a/.build/azure-pipelines-job-build.yml b/.build/azure-pipelines-job-build.yml index fb83e4e..1bceb4a 100644 --- a/.build/azure-pipelines-job-build.yml +++ b/.build/azure-pipelines-job-build.yml @@ -16,7 +16,7 @@ jobs: command: login - task: Docker@2 - displayName: Build + displayName: Build for AMD architecture inputs: command: build containerRegistry: 'DockerHub' @@ -25,13 +25,26 @@ jobs: $(DBCVER)-$(Build.BuildId) $(DBCVER) arguments: --build-arg DBCVER=$(DBCVER) - - task: Docker@2 - displayName: Push + displayName: Build for ARM architecture inputs: - command: push + command: build + Dockerfile: Dockerfile_ARM64 containerRegistry: 'DockerHub' repository: datathirstltd/dbconnect tags: | - $(DBCVER)-$(Build.BuildId) - $(DBCVER) + $(DBCVER)-$(Build.BuildId)-arm64 + $(DBCVER)-arm64 + arguments: --build-arg DBCVER=$(DBCVER) --platform linux/arm64/v8 + + # - task: Docker@2 + # displayName: Push + # inputs: + # command: push + # containerRegistry: 'DockerHub' + # repository: datathirstltd/dbconnect + # tags: | + # $(DBCVER)-$(Build.BuildId) + # $(DBCVER) + # $(DBCVER)-$(Build.BuildId)-arm64 + # $(DBCVER)-arm64 diff --git a/Dockerfile b/Dockerfile index f06d406..9354a17 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,4 +69,3 @@ ENV DEBIAN_FRONTEND=dialog # Allow for a consistant java home location for settings - image is changing over time RUN if [ ! -d "/docker-java-home" ]; then ln -s "${JAVA_HOME}" /docker-java-home; fi - diff --git a/Dockerfile_ARM64 b/Dockerfile_ARM64 new file mode 100644 index 0000000..c29d712 --- /dev/null +++ b/Dockerfile_ARM64 @@ -0,0 +1,71 @@ +#------------------------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. +#------------------------------------------------------------------------------------------------------------- +FROM arm64v8/openjdk:8-jdk + +# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser" +# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs +# will be updated to match your local UID/GID (when using the dockerFile property). +# See https://aka.ms/vscode-remote/containers/non-root-user for details. +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=$USER_UID +ARG DBCVER + +# Configure apt +ENV DEBIAN_FRONTEND=noninteractive + +# Mini Conda Start +ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 +ENV PATH /opt/conda/bin:$PATH +RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc + + +RUN apt-get update --fix-missing && \ + apt-get install -y wget bzip2 ca-certificates curl git && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh -O ~/miniconda.sh && \ + /bin/bash ~/miniconda.sh -b -p /opt/conda && \ + rm ~/miniconda.sh && \ + /opt/conda/bin/conda clean -tipsy && \ + ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ + echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ + echo "conda activate dbconnect" >> ~/.bashrc + + +ENV TINI_VERSION v0.16.1 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-arm64 /usr/bin/tini +RUN chmod +x /usr/bin/tini +ENTRYPOINT ["/usr/bin/tini", "--" ] +# CMD + + +COPY environments/environment${DBCVER}.yml . +RUN pip install --upgrade pip \ + && conda env create -f environment${DBCVER}.yml \ + && echo '{}' > /root/.databricks-connect + +# VSCode DevContainers +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ + # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user. + && groupadd --gid $USER_GID $USERNAME \ + && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ + # [Optional] Add sudo support for the non-root user + && apt-get install -y sudo \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ + && chmod 0440 /etc/sudoers.d/$USERNAME \ + # Verify git, needed tools installed + && apt-get -y install git iproute2 procps curl lsb-release + +# Clean up +RUN apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* +ENV DEBIAN_FRONTEND=dialog + +# Allow for a consistant java home location for settings - image is changing over time +RUN if [ ! -d "/docker-java-home" ]; then ln -s "${JAVA_HOME}" /docker-java-home; fi diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 07f5c93..ba63d51 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,8 +10,8 @@ stages: jobs: - template: .build/azure-pipelines-job-build.yml parameters: - DBCVER: 9.1.13 - DBCVERNODOTS: 9113 + DBCVER: 9.1.14 + DBCVERNODOTS: 9114 - template: .build/azure-pipelines-job-build.yml parameters: @@ -22,8 +22,3 @@ stages: parameters: DBCVER: 10.4.6 DBCVERNODOTS: 1046 - - - template: .build/azure-pipelines-job-build.yml - parameters: - DBCVER: 7.3.38 - DBCVERNODOTS: 7338 diff --git a/environments/environment9.1.14.yml b/environments/environment9.1.14.yml new file mode 100644 index 0000000..bd4caf3 --- /dev/null +++ b/environments/environment9.1.14.yml @@ -0,0 +1,8 @@ +name: dbconnect +channels: + - conda-forge +dependencies: + - python=3.8.12 + - pip: + - databricks-connect==9.1.14 + - six