You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run into an issue in which the Docker multi stage build seems to be exhibiting unexpected / undesirable behavior which is causing issues for st2packs usage.
In short;
The build instructions for the builder stage are being ignored when using the suggested docker build --build-arg PACKS="<pack names>" -t ${DOCKER_REGISTRY}/st2packs:<version_number> st2packs-image command.
[Bitovi] [st2packs-dockerfiles] $ docker run --rm -it awildphil/st2packs:1 sh
/ # ls /opt/stackstorm/
packs virtualenvs
/ # ls /opt/stackstorm/packs/
chatops core default linux packs
As you can see;
The st2-pack-install command wasn't invoked by the build
The aws pack is not where we expect it.
Fix
By adding the following COPY instructions to the bottom of the Dockerfile we get the expected behavior.
On Linux, the build instructions work as is.
So yeah, from the issue you mentioned, setting the DOCKER_BUILDKIT=0 fixes it on MacOS.
I'd prefer an ENV as a fix as it'll be less magic.
arm4b
changed the title
st2packs-image - docker multi stage build issue - builder stage being missed
st2packs-image - docker multi stage build issue - builder stage being missed on MacOS
Nov 30, 2022
Summary
I've run into an issue in which the Docker multi stage build seems to be exhibiting unexpected / undesirable behavior which is causing issues for st2packs usage.
Related Issue from buildkit moby/buildkit#816
In short;
The build instructions for the builder stage are being ignored when using the suggested
docker build --build-arg PACKS="<pack names>" -t ${DOCKER_REGISTRY}/st2packs:<version_number> st2packs-image
command.Issue visualized
command
docker build --no-cache --build-arg PACKS="aws" -t awildphil/st2packs:1 st2packs-image --progress plain
build logs
container logs
As you can see;
st2-pack-install
command wasn't invoked by the buildaws
pack is not where we expect it.Fix
By adding the following COPY instructions to the bottom of the Dockerfile we get the expected behavior.
st2pack-image/Dockerfile
command
export DOCKER_BUILDKIT=1; docker build --no-cache --build-arg PACKS="aws" -t awildphil/st2packs:1 st2packs-image --progress plain
build logs
container logs
Solution 2
command
export DOCKER_BUILDKIT=0; docker build --no-cache --build-arg PACKS="aws" -t awildphil/st2packs:1 st2packs-image --progress plain
Details
Docker Version: Docker version 20.10.7, build f0df350
OS Version: {
Big Sur - v11.6.4
Processor: 2.6 GHz 6-Core Intel Core i7
Memory: 32 GB 2667 MHz DDR4
}
The text was updated successfully, but these errors were encountered: