Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
aajith-arista committed Jan 2, 2024
1 parent 1e61df0 commit cb2e521
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions Dockerfile
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

View workflow job for this annotation

GitHub Actions / Lint

DL3040 warning: `dnf clean all` missing after dnf command.

Check failure on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / Lint

DL3041 warning: Specify version with `dnf install -y <package>-<version>`.
RUN dnf install -y epel-release-9* git-2.* jq-1.* \

Check failure on line 4 in Dockerfile

View workflow job for this annotation

GitHub Actions / Lint

DL3041 warning: Specify version with `dnf install -y <package>-<version>`.
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

Check failure on line 15 in Dockerfile

View workflow job for this annotation

GitHub Actions / Lint

DL3041 warning: Specify version with `dnf install -y <package>-<version>`.
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

Check failure on line 29 in Dockerfile

View workflow job for this annotation

GitHub Actions / Lint

DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.

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

0 comments on commit cb2e521

Please sign in to comment.