Skip to content

Commit

Permalink
Cleanup docker build.
Browse files Browse the repository at this point in the history
  • Loading branch information
quintush committed Jul 17, 2024
1 parent 656b272 commit 0b746ca
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion AlpineTest.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN apk add --update --no-cache curl ca-certificates git libc6-compat && \
apk del curl git && \
rm -f /var/cache/apk/* ;

RUN addgroup -g 1000 -S helmgroup && \
RUN addgroup -S helmgroup && \
adduser -u 1000 -S helmuser -G helmgroup

USER helmuser
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ ENV PLUGIN_URL="https://github.com/helm-unittest/helm-unittest/"
ENV HELM_DATA_HOME=/usr/local/share/helm

RUN apk add --update --no-cache curl ca-certificates git bash && \
curl -L ${HELM_BASE_URL}/${HELM_TAR_FILE} |tar xvz && \
curl -L ${HELM_BASE_URL}/${HELM_TAR_FILE} | tar xvz && \
mv ${TARGETOS}-${TARGETARCH}/helm /usr/bin/helm && \
chmod +x /usr/bin/helm && \
helm plugin install ${PLUGIN_URL} --version ${PLUGIN_VERSION} && \
rm -rf ${TARGETOS}-${TARGETARCH} && \
apk del curl git bash && \
rm -f /var/cache/apk/*

RUN addgroup -g 1000 -S helmgroup && \
RUN addgroup -S helmgroup && \
adduser -u 1000 -S helmuser -G helmgroup

USER helmuser
Expand Down
2 changes: 1 addition & 1 deletion Fedora.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN yum install -y git && \
yum remove -y git && \
rm -rf /var/cache/yum/* ;

RUN groupadd -g 1000 -r helmgroup \
RUN groupadd -r helmgroup \
&& useradd -u 1000 -r helmuser -g helmgroup

USER helmuser
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ dependency: ## Dependency maintanance

.PHONY: dockerimage
dockerimage: ## Build docker image
docker buildx build --load --no-cache --platform linux/amd64 --build-arg HELM_VERSION=$(HELM_VERSION) -t $(DOCKER):$(VERSION) -f Fedora.Dockerfile .
docker build --no-cache --build-arg HELM_VERSION=$(HELM_VERSION) -t $(DOCKER):$(VERSION) -f AlpineTest.Dockerfile .

.PHONY: test-docker
test-docker: dockerimage ## Execute 'helm unittests' in container
Expand Down
3 changes: 2 additions & 1 deletion docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ set -ex
build() {

echo "Found new version, building the image ${image}:${tag}"
docker buildx build --load --no-cache --platform linux/amd64,linux/arm64 --build-arg HELM_VERSION=${helmVersion} --build-arg PLUGIN_VERSION=${pluginVersion} -t ${image}:${tag} .
docker build --no-cache --build-arg HELM_VERSION=${helmVersion} --build-arg PLUGIN_VERSION=${pluginVersion} -t ${image}:${tag} .
# docker buildx build --load --no-cache --platform linux/amd64,linux/arm64 --build-arg HELM_VERSION=${helmVersion} --build-arg PLUGIN_VERSION=${pluginVersion} -t ${image}:${tag} .

# run test
version=$(docker run -ti --entrypoint "helm" --rm ${image}:${tag} version --client)
Expand Down

0 comments on commit 0b746ca

Please sign in to comment.