<commit_before># Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine:3.8 as builder

RUN apk add --no-cache \
    bash=4.4.19-r1 \
    git=2.18.1-r0 \
    go=1.10.5-r0 \
    make=4.2.1-r2 \
    musl-dev=1.1.19-r10

ENV APP_BASE_DIR="/cftk"

RUN mkdir -p $APP_BASE_DIR/home && \
    mkdir -p $APP_BASE_DIR/bin && \
    mkdir -p $APP_BASE_DIR/workdir

ENV GOPATH="/root/go"

ARG BUILD_PROVIDER_GOOGLE_VERSION
ENV PROVIDER_GOOGLE_VERSION="${BUILD_PROVIDER_GOOGLE_VERSION}"

RUN mkdir -p $APP_BASE_DIR/home/.terraform.d/plugins && \
    mkdir -p $GOPATH/src/github.com/terraform-providers && \
    git clone https://github.com/terraform-providers/terraform-provider-google.git $GOPATH/src/github.com/terraform-providers/terraform-provider-google

WORKDIR $GOPATH/src/github.com/terraform-providers/terraform-provider-google
RUN git fetch --all --tags --prune && \
    git checkout tags/v${PROVIDER_GOOGLE_VERSION} -b v${PROVIDER_GOOGLE_VERSION} && \
    make build && \
    mv $GOPATH/bin/terraform-provider-google $APP_BASE_DIR/home/.terraform.d/plugins



FROM alpine:3.8

RUN apk add --no-cache \
        bash=4.4.19-r1 \
        curl=7.61.1-r0 \
        git=2.18.0-r0 \
        jq=1.6_rc1-r1 \
        make=4.2.1-r2 \
        python2=2.7.15-r1

ENV APP_BASE_DIR="/cftk"

COPY --from=builder $APP_BASE_DIR $APP_BASE_DIR

ENV HOME="$APP_BASE_DIR/home"
ENV PATH $APP_BASE_DIR/bin:$APP_BASE_DIR/google-cloud-sdk/bin:$PATH
ENV GOOGLE_APPLICATION_CREDENTIALS="$CREDENTIALS_PATH" \
    CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE="$CREDENTIALS_PATH"

# Fix base64 inconsistency<commit_msg>Update curl, git in Dockerfile<commit_after># Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine:3.8 as builder

RUN apk add --no-cache \
    bash=4.4.19-r1 \
    git=2.18.1-r0 \
    go=1.10.5-r0 \
    make=4.2.1-r2 \
    musl-dev=1.1.19-r10

ENV APP_BASE_DIR="/cftk"

RUN mkdir -p $APP_BASE_DIR/home && \
    mkdir -p $APP_BASE_DIR/bin && \
    mkdir -p $APP_BASE_DIR/workdir

ENV GOPATH="/root/go"

ARG BUILD_PROVIDER_GOOGLE_VERSION
ENV PROVIDER_GOOGLE_VERSION="${BUILD_PROVIDER_GOOGLE_VERSION}"

RUN mkdir -p $APP_BASE_DIR/home/.terraform.d/plugins && \
    mkdir -p $GOPATH/src/github.com/terraform-providers && \
    git clone https://github.com/terraform-providers/terraform-provider-google.git $GOPATH/src/github.com/terraform-providers/terraform-provider-google

WORKDIR $GOPATH/src/github.com/terraform-providers/terraform-provider-google
RUN git fetch --all --tags --prune && \
    git checkout tags/v${PROVIDER_GOOGLE_VERSION} -b v${PROVIDER_GOOGLE_VERSION} && \
    make build && \
    mv $GOPATH/bin/terraform-provider-google $APP_BASE_DIR/home/.terraform.d/plugins



FROM alpine:3.8

RUN apk add --no-cache \
    bash=4.4.19-r1 \
    curl=7.61.1-r1 \
    git=2.18.1-r0 \
    jq=1.6_rc1-r1 \
    make=4.2.1-r2 \
    python2=2.7.15-r1

ENV APP_BASE_DIR="/cftk"

COPY --from=builder $APP_BASE_DIR $APP_BASE_DIR

ENV HOME="$APP_BASE_DIR/home"
ENV PATH $APP_BASE_DIR/bin:$APP_BASE_DIR/google-cloud-sdk/bin:$PATH
ENV GOOGLE_APPLICATION_CREDENTIALS="$CREDENTIALS_PATH" \
    CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE="$CREDENTIALS_PATH"

# Fix base64 inconsistency
{'fraction_non_alphanumeric': 0.11933570581257413, 'fraction_numerical': 0.03226571767497034, 'mean_word_length': 3.5382131324004304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3931163', 'n_tokens_mistral': 1630, 'n_tokens_neox': 1554, 'n_words': 347}