two stage building

This commit is contained in:
Jamie Li
2021-10-18 18:49:57 -04:00
parent c8b68d31ab
commit 38f0f1bd3f
7 changed files with 47 additions and 3 deletions
+1
View File
@@ -1,3 +1,4 @@
release
coverage.out
vendor
buildah-binaries
+33
View File
@@ -0,0 +1,33 @@
FROM fedora
RUN dnf -y install \
make \
golang \
bats \
btrfs-progs-devel \
device-mapper-devel \
glib2-devel \
gpgme-devel \
libassuan-devel \
libseccomp-devel \
git \
bzip2 \
go-md2man \
runc \
containers-common \
skopeo-containers
# Workaround - the first install somehow leaves the golang in a bad state
RUN dnf -y install golang
ARG GIT_USER_NAME
RUN git config --global user.name "$GIT_USER_NAME"
ARG GIT_USER_EMAIL
RUN git config --global user.email "$GIT_USER_EMAIL"
RUN mkdir /root/buildah && \
cd /root/buildah && \
git clone https://github.com/harness/buildah.git ./src/github.com/containers/buildah
RUN cd /root/buildah/src/github.com/containers/buildah && make && sudo make install
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
docker build --build-arg=GIT_USER_NAME="$(git config user.name)" --build-arg=GIT_USER_EMAIL="$(git config user.email)" \
-f Dockerfile-build-buildah -t buildah-dev .
mkdir buildah-binaries
docker container create --name extract buildah-dev
docker container cp extract:/root/buildah/src/github.com/containers/buildah/bin ./buildah-binaries
docker container rm -f extract
+3 -3
View File
@@ -5,7 +5,7 @@ WORKDIR /home/build
RUN export STORAGE_DRIVER=vfs
# Add plugin binary
ADD release/linux/amd64/drone-docker /bin/
ADD prebuilt/buildah /bin/
ADD prebuilt/imgtype /bin/
ADD prebuilt/copy /bin/
ADD buildah-binaries/bin/buildah /bin/
ADD buildah-binaries/bin/imgtype /bin/
ADD buildah-binaries/bin/copy /bin/
ENTRYPOINT ["/bin/drone-docker"]
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.