Skip to content

Commit

Permalink
feat(buildah): publish initial werf image with compiled werf binary a…
Browse files Browse the repository at this point in the history
…nd buildah environment

* Image published by the commit for now: ghcr.io/werf/werf:COMMIT.
* Image includes full buildah environment for now rather than minimal werf dependencies.
  • Loading branch information
distorhead committed Nov 26, 2021
1 parent 9b1f16a commit 20dde28
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/werf-in-docker/Dockerfile
@@ -0,0 +1,15 @@
FROM ghcr.io/werf/builder:afd00fa1348645658b718df6b2b7447c6cead90b@sha256:829a6fd3d5850fc24366b5a3fb10402fe2d5615dcfd045b7225819c7a8ec5011
ARG build_version
ADD cmd /werf/cmd
ADD pkg /werf/pkg
ADD go.mod /werf/go.mod
ADD go.sum /werf/go.sum
ADD scripts/build_release_v3.sh /werf/scripts/build_release_v3.sh
RUN cd /werf && go mod download
RUN cd /werf && ./scripts/build_release_v3.sh $build_version

FROM ghcr.io/werf/buildah:v1.22.3-1
ARG build_version
RUN yum install -y git curl gpg
COPY --from=0 /werf/release-build/$build_version/linux-amd64/bin/werf /usr/local/bin/werf
ENV WERF_CONTAINER_RUNTIME_BUILDAH=native-rootless
7 changes: 7 additions & 0 deletions scripts/werf-in-docker/build.sh
@@ -0,0 +1,7 @@
#!/bin/bash

set -e

BUILD_VERSION="$(git rev-parse HEAD)"
IMAGE_NAME=ghcr.io/werf/werf:$BUILD_VERSION
docker build -f scripts/werf-in-docker/Dockerfile --build-arg build_version=$BUILD_VERSION -t $IMAGE_NAME .
6 changes: 6 additions & 0 deletions scripts/werf-in-docker/publish.sh
@@ -0,0 +1,6 @@
#!/bin/bash

set -e

IMAGE_NAME=ghcr.io/werf/werf:"$(git rev-parse HEAD)"
docker push $IMAGE_NAME

0 comments on commit 20dde28

Please sign in to comment.