two stage

This commit is contained in:
Jamie Li 2021-10-19 13:20:58 -04:00
parent 492e84d4b0
commit 6d4ce8c5ac
3 changed files with 33 additions and 38 deletions

View File

@ -1,27 +0,0 @@
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
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

View File

@ -1,3 +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
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
FROM quay.io/buildah/stable:v1.23.0
USER build
@ -5,7 +35,6 @@ WORKDIR /home/build
RUN export STORAGE_DRIVER=vfs
# Add plugin binary
ADD release/linux/amd64/drone-docker /bin/
ADD release/linux/amd64/buildah /bin/
ADD release/linux/amd64/imgtype /bin/
ADD release/linux/amd64/copy /bin/
COPY --from=0 /root/buildah/src/github.com/containers/buildah/bin/. /bin/
ENTRYPOINT ["/bin/drone-docker"]

View File

@ -15,10 +15,3 @@ GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-ecr ./cmd/drone
GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-docker ./cmd/drone-docker
GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-acr ./cmd/drone-acr
GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-heroku ./cmd/drone-heroku
#build buildah binaries
docker build -f Dockerfile-build-buildah -t buildah-dev .
docker container create --name extract buildah-dev
docker container cp extract:/root/buildah/src/github.com/containers/buildah/bin/. release/linux/amd64/
docker container rm -f extract