Skip to content

Commit

Permalink
fix: CVE-2021-3997 in image build
Browse files Browse the repository at this point in the history
fix tess
  • Loading branch information
andyzhangx committed Jan 14, 2022
1 parent 79a34dc commit 98191a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
export REGISTRY=test
export IMAGE_VERSION=latest
export DOCKER_CLI_EXPERIMENTAL=enabled
make
make container-build
make container
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
Expand Down
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu
FROM k8s.gcr.io/build-image/debian-base:bullseye-v1.0.0

RUN apt update && apt-mark unhold libcap2
RUN clean-install ca-certificates mount
# install updated packages to fix CVE issues
RUN clean-install libssl1.1 libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 libgmp10

# Copy iscsiplugin.sh
COPY iscsiplugin.sh /iscsiplugin.sh
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ OUTPUT_TYPE ?= docker
ARCH ?= amd64
IMAGE_TAG = $(REGISTRY)/$(IMAGENAME):$(IMAGE_VERSION)

.PHONY: container-build
container-build:
.PHONY: container
container:
make
docker buildx build --pull --output=type=$(OUTPUT_TYPE) --platform="linux/$(ARCH)" \
-t $(IMAGE_TAG) --build-arg ARCH=$(ARCH) .

Expand Down

0 comments on commit 98191a7

Please sign in to comment.