Building custom image on 2.3.4

Hello there,

I was used to build my custom rasa open source image with docker build command using 2.0.7, but today after updating our repo to 2.3.4 I’m no longer able to use that to build custom images.

Does anyone know how I could accomplish the same in the current version?

Thanks in advance, have a wonderful week!

Hi @dgslv, could you share the command you are using for the image build and any errors you are getting?

1 Like

I’m use to use the following command from the root path: docker build -t {MY_TAG_NAME} -f docker/Dockerfile_full .

With the latest releases I cannot use this command anymore because it’s demmand that I have some env vars regarding the following:

ARG IMAGE_BASE_NAME ARG BASE_IMAGE_HASH ARG BASE_MITIE_IMAGE_HASH ARG BASE_BUILDER_IMAGE_HASH

How could I know which values to pass to my build function? How could I accomplish my custom build after latest modifications?

Hi @dgslv

As you can find in the README file you should use make to build a Docker image locally.

The following command should help you

make build-docker
1 Like

Hello @tczekajlo,

Can’t believe I’d missed that. I appreciate your attention.

Thanks.

Diego

Hey @tczekajlo

I tried what you recommended and got the following error:

make build-docker

export IMAGE_NAME=rasa && \

docker buildx use default && \

docker buildx bake -f docker/docker-bake.hcl base && \

docker buildx bake -f docker/docker-bake.hcl base-poetry && \

docker buildx bake -f docker/docker-bake.hcl base-builder && \

docker buildx bake -f docker/docker-bake.hcl default

invalid tag "${IMAGE_NAME}:base-${IMAGE_TAG}": invalid reference format

Makefile:221: recipe for target 'build-docker' failed

make: *** [build-docker] Error 1

Could you help me to understand why it did not work? I mean, why IMAGE_TAG is not being set by default?

The IMAGE_TAG variable is set to localdev as default (rasa/docker-bake.hcl at 4e618780c8b2a2a0bcdf9d24d9bbc1040cb6b6dc · RasaHQ/rasa · GitHub)

In your output message, I can see something like this

invalid tag "${IMAGE_NAME}:base-${IMAGE_TAG}": invalid reference format

Don’t you already set IMAGE_TAG variable that overrides the default one? (you can use env to check it)

Please check if you didn’t define IMAGE_TAG or IMAGE_NAME that overrides the defaults and make that tag format is incorrect.

Also, which version of docker do you use?

Hello @tczekajlo,

I’ve checked I wasn’t setting a value for the tags mentioned, and I actually have not. there follows my terminal outputs: ubuntu@ip-xxxxx:/etc/rasa/rasa-2.3.4$ echo $IMAGE_TAG

ubuntu@ip-xxxx:/etc/rasa/rasa-2.3.4$ echo $IMAGE_NAME

docker version
Client: Docker Engine - Community
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        48a66213fe
 Built:             Mon Jun 22 15:45:36 2020
 OS/Arch:           linux/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.12
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       48a66213fe
  Built:            Mon Jun 22 15:44:07 2020
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
ubuntu@ip-xxxxx:/etc/rasa/rasa-2.3.4$ ak^C
ubuntu@ip-xxxxx:/etc/rasa/rasa-2.3.4$ make build-docker
export IMAGE_NAME=rasa && \
docker buildx use default && \
docker buildx bake -f docker/docker-bake.hcl base && \
docker buildx bake -f docker/docker-bake.hcl base-poetry && \
docker buildx bake -f docker/docker-bake.hcl base-builder && \
docker buildx bake -f docker/docker-bake.hcl default
invalid tag "${IMAGE_NAME}:base-${IMAGE_TAG}": invalid reference format
Makefile:221: recipe for target 'build-docker' failed
make: *** [build-docker] Error 1

I see where is the issue, can you update docker to the latest version?

(or update only buildx)

Download the latest binary release from https://github.com/docker/buildx/releases/latest and copy it to ~/.docker/cli-plugins folder with name docker-buildx.

Change the permission to execute: chmod a+x ~/.docker/cli-plugins/docker-buildx

It worked, @tczekajlo!

Thanks a lot for your time. I appreciate it.

Diego