mirror of
https://github.com/drone-plugins/drone-buildah.git
synced 2026-06-04 10:15:27 +08:00
two stage building
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
release
|
||||
coverage.out
|
||||
vendor
|
||||
buildah-binaries
|
||||
|
||||
@@ -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
|
||||
Executable
+10
@@ -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
|
||||
@@ -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"]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user