-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e61df0
commit cb2e521
Showing
1 changed file
with
25 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,42 @@ | ||
# syntax=docker/dockerfile:1.3 | ||
FROM rockylinux:9.0.20220720 AS base | ||
FROM quay.io/almalinuxorg/9-minimal:9.3-20231124 AS base | ||
RUN microdnf install -y dnf | ||
Check failure on line 3 in Dockerfile GitHub Actions / Lint
|
||
RUN dnf install -y epel-release-9* git-2.* jq-1.* \ | ||
openssl-3.* python3-pip-21.* python3-pyyaml-5.* \ | ||
rpmdevtools-9.* sudo-1.* && \ | ||
dnf install -y mock-3.* automake-1.16.* && \ | ||
dnf install -y wget-1.21.* && dnf clean all | ||
dnf install -y mock-5.* automake-1.16.* && \ | ||
dnf install -y wget-1.21.* && \ | ||
dnf install -y vim-enhanced emacs && dnf clean all | ||
RUN useradd -s /bin/bash mockbuild -p "$(openssl passwd -1 mockbuild)" | ||
CMD ["bash"] | ||
|
||
FROM base as builder | ||
ARG EEXT_ROOT=. | ||
USER root | ||
RUN dnf install -y golang-1.18.* && dnf clean all | ||
RUN mkdir -p src && mkdir -p bin | ||
WORKDIR /src | ||
COPY ./${EEXT_ROOT}/go.mod ./ | ||
COPY ./${EEXT_ROOT}/go.sum ./ | ||
RUN dnf install -y golang && dnf clean all | ||
RUN mkdir -p /src/code.arista.io/eos/tools/eext && mkdir -p /usr/bin | ||
WORKDIR /src/code.arista.io/eos/tools/eext | ||
COPY ./go.mod ./ | ||
COPY ./go.sum ./ | ||
COPY ./*.go ./ | ||
COPY ./cmd/ cmd/ | ||
COPY ./impl/ impl/ | ||
COPY ./util/ util/ | ||
COPY ./testutil/ testutil/ | ||
COPY ./manifest/ manifest/ | ||
COPY ./dnfconfig/ dnfconfig/ | ||
COPY ./srcconfig/ srcconfig/ | ||
RUN go mod download | ||
COPY ./${EEXT_ROOT}/*.go ./ | ||
COPY ./${EEXT_ROOT}/cmd/ cmd/ | ||
COPY ./${EEXT_ROOT}/impl/ impl/ | ||
COPY ./${EEXT_ROOT}/util/ util/ | ||
COPY ./${EEXT_ROOT}/testutil/ testutil/ | ||
COPY ./${EEXT_ROOT}/manifest/ manifest/ | ||
COPY ./${EEXT_ROOT}/dnfconfig/ dnfconfig/ | ||
RUN go build -o /bin/eext && \ | ||
go test ./... && \ | ||
GO111MODULE=off go get -u golang.org/x/lint/golint && \ | ||
PATH="$PATH:$HOME/go/bin" golint -set_exit_status ./... && \ | ||
go vet ./... && \ | ||
test -z "$(gofmt -l .)" | ||
RUN go build -o /usr/bin/eext | ||
|
||
FROM base as deploy | ||
ARG EEXT_ROOT=. | ||
ARG CFG_DIR=/usr/share/eext | ||
ARG MOCK_CFG_TEMPLATE=mock.cfg.template | ||
ARG DNF_CFG_FILE=dnfconfig.yaml | ||
ARG DNF_CFG_FILE=srcconfig.yaml | ||
COPY --from=builder /bin/eext /usr/bin/ | ||
COPY ./${EEXT_ROOT}/configfiles/${MOCK_CFG_TEMPLATE} ${CFG_DIR}/${MOCK_CFG_TEMPLATE} | ||
COPY ./${EEXT_ROOT}/configfiles/${DNF_CFG_FILE} ${CFG_DIR}/${DNF_CFG_FILE} | ||
COPY ./configfiles/${MOCK_CFG_TEMPLATE} ${CFG_DIR}/${MOCK_CFG_TEMPLATE} | ||
COPY ./configfiles/${DNF_CFG_FILE} ${CFG_DIR}/${DNF_CFG_FILE} | ||
COPY ./configfiles/${SRC_CFG_FILE} ${CFG_DIR}/${SRC_CFG_FILE} | ||
RUN mkdir -p /etc/pki/eext | ||
COPY ./${EEXT_ROOT}/pki/*.pem /etc/pki/eext/ | ||
COPY ./pki /etc/pki/eext | ||
RUN mkdir /var/eext && chmod 0777 /var/eext && mkdir /dest && chmod 0777 /dest |