Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Commit 2d3c001

Browse files
committed
Working.
1 parent d3f5aa5 commit 2d3c001

File tree

4 files changed

+17
-34
lines changed

4 files changed

+17
-34
lines changed

.gitlab-ci.yml

-19
This file was deleted.

Dockerfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
FROM ubuntu:20.04
2-
3-
ARG FROMPLACE=kaniko:local
4-
5-
# Add .docker config dir
62
RUN mkdir -p /kaniko/.docker
7-
COPY --from=$FROMPLACE /kaniko/executor /usr/local/bin/kaniko
8-
COPY kaniko/files/nsswitch.conf /etc/nsswitch.conf
3+
# From 2 will grab the files we need from the kaniko image. This only works when this dockerfile has been appended to
4+
# the actual debug dockerfile in the kaniko repo.
5+
COPY --from=2 /kaniko/executor /usr/local/bin/kaniko
6+
COPY files/nsswitch.conf /etc/nsswitch.conf
97
ENV HOME /root
108
ENV USER root
119
ENV PATH /usr/local/bin:/bin:$PATH
1210
ENV DOCKER_CONFIG /kaniko/.docker/
11+
12+
# Now that we have all the kaniko files we need, install the additional tools we want to use.
1313
ENV DEBIAN_FRONTEND=noninteractive
1414
RUN apt-get update && apt-get install -y \
1515
curl \

Makefile

+4-8
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
build-debug:
33
docker buildx rm "build-$$(git rev-parse --short HEAD)" || true
44
docker buildx create --platform linux/amd64 --use --name "build-$$(git rev-parse --short HEAD)"
5-
# docker buildx build --platform linux/amd64 \
6-
# -o type=docker \
7-
# -f kaniko/deploy/Dockerfile_debug \
8-
# -t containers.harderthanitneedstobe.com/kaniko ./kaniko
9-
docker buildx build --platform linux/amd64 \
10-
-f Dockerfile \
11-
--push \
12-
-t containers.harderthanitneedstobe.com/kaniko-test .
5+
printf "$$(cat kaniko/deploy/Dockerfile_debug)\n\n$$(cat Dockerfile)" | docker buildx build --platform linux/amd64 \
6+
-f - \
7+
-t containers.harderthanitneedstobe.com/kaniko:$$(git rev-parse --short HEAD) ./kaniko \
8+
--push

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# kaniko-ci
22

3-
Using kaniko to build kaniko.
3+
This is a build container that takes Kaniko and lifts it into a more useful image (ubuntu) so that other tools can be
4+
used alongside it (git, make, etc). This is technically not supported by kaniko, but so far it works and makes building
5+
pipelines much easier.
6+
7+
We use the actual Kaniko repo as a submodule, and we build the container by appending our `Dockerfile` onto the end of
8+
their `Dockerfile_debug`. This way we are still staying true to how kaniko is meant to be built; but we can add our own
9+
tools in at the end as well as push our container to our own registry.

0 commit comments

Comments
 (0)