Skip to content

Commit

Permalink
Fix azcli on godynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-at-luther committed Feb 24, 2024
1 parent b7fcc89 commit ceaa827
Showing 1 changed file with 20 additions and 30 deletions.
50 changes: 20 additions & 30 deletions images/Dockerfile.build-godynamic
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,18 @@ RUN set -ex; \
# Azure CLI builder
#

FROM python:3.8-alpine${ALPINE_VERSION} as azcli
FROM alpine:${ALPINE_VERSION} as azcli

ARG AZCLI_VER
ENV AZCLI_VER=$AZCLI_VER

WORKDIR /az

RUN set -ex; \
apk add --no-cache \
build-base libffi-dev openssl-dev cargo python3-dev

RUN set -eux; \
mkdir /az; \
python -m venv /az/venv; \
. /az/venv/bin/activate; \
build-base libffi-dev openssl-dev cargo python3-dev py3-pip; \
python3 -m venv ./venv; \
. ./venv/bin/activate; \
pip install --no-cache-dir azure-cli==${AZCLI_VER}

#
Expand All @@ -70,43 +69,34 @@ MAINTAINER Sam Wood <sam.wood@luthersystems.com>
CMD ["/bin/sh"]
RUN test -e /etc/nsswitch.conf || echo "hosts: files dns" >/etc/nsswitch.conf

COPY --from=go-alpine-downloader /usr/local/go/ /usr/local/go/

ENV GOPATH=/go
ENV GOCACHE /tmp
ENV PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR /go
RUN apk add --no-cache ca-certificates tzdata libltdl rsync zip openssh git-lfs bash shadow gcc musl-dev make linux-headers curl tini gcompat python3 jq py3-pip groff

RUN apk add --no-cache docker docker-compose openrc
RUN rc-update add docker boot
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" && \
apk add --no-cache ca-certificates tzdata libltdl rsync zip openssh git-lfs bash shadow gcc musl-dev make linux-headers curl tini gcompat jq python3-dev py3-pip groff docker docker-compose openrc && \
rc-update add docker boot

ENTRYPOINT ["tini", "--", "make", "-f", "/opt/Dockerfile.godynamic.mk"]
COPY build-godynamic.mk /opt/Dockerfile.godynamic.mk
COPY Dockerfile.build-godynamic.static /opt/Dockerfile.godynamic.static
ENV GOCACHE /tmp

# set up private repo access for go mod
RUN git config --system url."git@bitbucket.org:".insteadOf "https://bitbucket.org/"
RUN git config --system url."git@github.com:luthersystems/license.git".insteadOf "https://github.com/luthersystems/license"
RUN git config --system url."git@github.com:luthersystems/lutherauth-sdk-go.git".insteadOf "https://github.com/luthersystems/lutherauth-sdk-go"
RUN git config --system url."git@github.com:luthersystems/substrate.git".insteadOf "https://github.com/luthersystems/substrate"
RUN git config --system url."git@github.com:luthersystems/chainidentifier.git".insteadOf "https://github.com/luthersystems/chainidentifier"

RUN ssh-keyscan -t Ed25519 -H bitbucket.org | tee -a /etc/ssh/ssh_known_hosts
RUN ssh-keyscan -t Ed25519 -H github.com | tee -a /etc/ssh/ssh_known_hosts

ENTRYPOINT ["tini", "--", "make", "-f", "/opt/Dockerfile.godynamic.mk"]
RUN git config --system url."git@bitbucket.org:".insteadOf "https://bitbucket.org/"; \
git config --system url."git@github.com:luthersystems/license.git".insteadOf "https://github.com/luthersystems/license"; \
git config --system url."git@github.com:luthersystems/lutherauth-sdk-go.git".insteadOf "https://github.com/luthersystems/lutherauth-sdk-go"; \
git config --system url."git@github.com:luthersystems/substrate.git".insteadOf "https://github.com/luthersystems/substrate"; \
git config --system url."git@github.com:luthersystems/chainidentifier.git".insteadOf "https://github.com/luthersystems/chainidentifier"; \
ssh-keyscan -t Ed25519 -H bitbucket.org | tee -a /etc/ssh/ssh_known_hosts; \
ssh-keyscan -t Ed25519 -H github.com | tee -a /etc/ssh/ssh_known_hosts

COPY --from=go-alpine-downloader /usr/local/go/ /usr/local/go/
COPY --from=go-alpine-downloader /go/bin/go-bindata /go/bin/go-bindata
COPY --from=go-alpine-downloader /go/bin/gotestsum /go/bin/gotestsum
COPY --from=go-alpine-downloader /go/bin/golangci-lint /go/bin/golangci-lint

ARG AZCLI_VER
ENV AZCLI_VER=$AZCLI_VER

COPY --from=aws /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=aws /aws-cli-bin/ /usr/local/bin/

COPY --from=azcli /az/venv /az/venv
COPY --from=azcli /az /az

ENV PATH="/az/venv/bin:$PATH"

0 comments on commit ceaa827

Please sign in to comment.