# Build docker image for lastest flowable-rest.war

**URL:** <https://forum.flowable.org/t/build-docker-image-for-lastest-flowable-rest-war/11160>\
**Category:** Uncategorized\
**Created:** [January 3, 2024, 4:03pm UTC](https://forum.flowable.org/t/build-docker-image-for-lastest-flowable-rest-war/11160 "2024-01-03T16:03:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngthanhvu](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@ngthanhvu](https://forum.flowable.org/u/ngthanhvu)\
**Post date:** [January 3, 2024, 4:03pm UTC](https://forum.flowable.org/t/build-docker-image-for-lastest-flowable-rest-war/11160/1 "2024-01-03T16:03:56Z")

</div>

Hi

I want to build docker file for flowable-rest 7.0.0 because I want to add some custome bean/class into it.

Below is Dockerfile, I can build the image, can run it (without error) but CANNOT access to the rest api. Please help

======================

# Use an official Tomcat runtime as a parent image

FROM tomcat:8.5-jdk17

ENV DIRPATH /usr/local/tomcat

# Copy Tomcat users into the container at /conf

COPY ./tomcat-users.xml $DIRPATH/conf

# Copy flowable-admin war file into the container at /webapps

COPY ./wars/flowable-rest.war $DIRPATH/webapps

EXPOSE 8080

# Run CMD “catalina.sh” when the container launches

CMD [“catalina.sh”, “run”]

---

<div class="post-metadata">

**Author:** ![yvo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/yvo/32/2231_2.png) [@yvo](https://forum.flowable.org/u/yvo)\
**Post date:** [January 10, 2024, 7:14am UTC](https://forum.flowable.org/t/build-docker-image-for-lastest-flowable-rest-war/11160/2 "2024-01-10T07:14:39Z")

</div>

Hi @ngthanhvu

Why don’t you use the Flowable image itself as the base image?

Yvo

---

<div class="post-metadata">

**Author:** ![ngthanhvu](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@ngthanhvu](https://forum.flowable.org/u/ngthanhvu)\
**Post date:** [January 10, 2024, 2:47pm UTC](https://forum.flowable.org/t/build-docker-image-for-lastest-flowable-rest-war/11160/3 "2024-01-10T14:47:02Z")

</div>

Hi @yvo

I want to learn how to build from the .war file.

Base on this, I also want to add some custom bean to use in Service Task.

Can you guide me how to add custom bean? It is more important than build image from beginning now.

Thanks.

---

<div class="post-metadata">

**Author:** ![yvo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/yvo/32/2231_2.png) [@yvo](https://forum.flowable.org/u/yvo)\
**Post date:** [January 10, 2024, 3:17pm UTC](https://forum.flowable.org/t/build-docker-image-for-lastest-flowable-rest-war/11160/4 "2024-01-10T15:17:55Z")

</div>

You can add a jar containing the delegate(s) to the Docker image.

`Dockerfile`

```auto
FROM flowable/flowable-rest
COPY test.jar /app/WEB-INF/lib

```

```sh
docker build . -t flowable-rest-custom

```

This will build you a new image ‘flowable-rest-custom’ with the test.jar on the class path.

Hope this helps.

Yvo

---

<div class="post-metadata">

**Author:** ![ngthanhvu](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@ngthanhvu](https://forum.flowable.org/u/ngthanhvu)\
**Post date:** [January 10, 2024, 3:40pm UTC](https://forum.flowable.org/t/build-docker-image-for-lastest-flowable-rest-war/11160/5 "2024-01-10T15:40:59Z")

</div>

Thank @yvo

This is really helpful.

I case I want to use a common Bean (bean has one method with some param) to minimize buid & deploy docker again. This way will help ?

thank.

---

<div class="post-metadata">

**Author:** ![yvo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/yvo/32/2231_2.png) [@yvo](https://forum.flowable.org/u/yvo)\
**Post date:** [January 10, 2024, 3:56pm UTC](https://forum.flowable.org/t/build-docker-image-for-lastest-flowable-rest-war/11160/6 "2024-01-10T15:56:25Z")

</div>

For this approach it’s easier to set the class (that implements the JavaDelegate interface) on the service task. So that Flowable instantiates this.  
If you want to use Spring beans then more configuration is required. In that cause I would create a custom project and build that.  
But if that is not needed the first approach is really quick and easy.

Yvo

---

<div class="post-metadata">

**Author:** ![ngthanhvu](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@ngthanhvu](https://forum.flowable.org/u/ngthanhvu)\
**Post date:** [January 10, 2024, 4:01pm UTC](https://forum.flowable.org/t/build-docker-image-for-lastest-flowable-rest-war/11160/7 "2024-01-10T16:01:42Z")

</div>

My situation is that the project team is using .NET as a main programming language so they don’t have many experience in Java that why I want to have a custom bean intead of write Java delegate for each service task.

Anyway, thank you so much.
