This task is about cloning app files from previous repository instead of copying them from machne.
First of all you will need buildctl, if you don't have it, you can download it from https://github.com/moby/buildkit/releases/tag/v0.13.1.
On linux based system after extracting tar.gz copy content of bin folder to your /bin/ path, example:
If you're in bin folder:
cp ./* /bin/Now check if installation is successful by typing in terminal:
buildctlNext step is to run buildkit in a container:
docker run -d --name buildkitd --privileged moby/buildkit:latestAfter that you need to point out the default host to variable BUILDKIT_HOST:
export BUILD_HOST=docker-container://buildkitdOne before last step is build an image with buildctl:
buildctl build --frontend=dockerfile.v0 --ssh default=$SSH_AUTH_SOCK --local context=. --local dockerfile=. --opt build-arg:VERSION=1.0.0 --output type=image,name=ghcr.io/sawyyy/pawcho6:lab6,push=trueLast step - starting container:
docker run -d --rm -p 80:80 --name app ghcr.io/sawyyy/pawcho6:lab6After running containter you can test if it's working by typing in terminal (if you have curl installed):
curl http://localhost:80Or just put:
http://localhost:80In your web browser
If you encounter an error:
error: listing workers for Build: failed to list workers: Unavailable: connection error: desc = "error reading server preface: command [docker exec -i buildkitd buildctl dial-stdio] has exited with exit status 1, please make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=Error response from daemon: No such container: buildkitd\n"
Check if name of buildkit container is same as name at the end of export command
Also make sure if port 80 isn't already allocated, otherway you change it in docker run command