# Trouble adding SES plugin to a Dockerfile (so I can build my own image)

**URL:** <https://forum.mautic.org/t/trouble-adding-ses-plugin-to-a-dockerfile-so-i-can-build-my-own-image/32046>\
**Category:** Mautic 5 Install/Upgrade Support\
**Created:** [May 12, 2024, 1:52am UTC](https://forum.mautic.org/t/trouble-adding-ses-plugin-to-a-dockerfile-so-i-can-build-my-own-image/32046 "2024-05-12T01:52:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![scornflake](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/scornflake/32/11990_2.png) [@scornflake](https://forum.mautic.org/u/scornflake)\
**Post date:** [May 12, 2024, 1:52am UTC](https://forum.mautic.org/t/trouble-adding-ses-plugin-to-a-dockerfile-so-i-can-build-my-own-image/32046/1 "2024-05-12T01:52:36Z")

</div>

**Your software**  
My Mautic version is: 5.0.4  
My PHP version is: 8.1  
My Database type and version is: 8.0 mysql

Im trying to build my own docker images, since it appears you cannot install the [Amazon SES plugin](https://github.com/pabloveintimilla/mautic-amazon-ses) from the UI itself. I should mention I’ve got a stock Mautic running just find using the provided docker compose files, and I’m using the 5-apache variant behind a traefik2 proxy. No prob there.

I want to use the SES plugin, because the docs mention I can’t configure bounce handling since:

> Some Email services overwrite the return-path header with that of the account’s Email (GMail, Amazon SES). In these cases, IMAP bounce monitoring won’t work.

Steps taken so far:

What I’ve done so far is clone [GitHub - mautic/docker-mautic: Docker Image for Mautic](https://github.com/mautic/docker-mautic).  
I’ve then modified the apache example Dockerfile like so:

```auto
.... (use stable? not dev?) ....
# Define Mautic version by package tag
ARG MAUTIC_VERSION=^5.0

RUN cd /opt && COMPOSER_ALLOW_SUPERUSER=1 COMPOSER_PROCESS_TIMEOUT=10000 composer create-project mautic/recommended-project:${MAUTIC_VERSION} mautic --no-interaction

RUN rm -rf /opt/mautic/var/cache/js

RUN find /opt/mautic/node_modules -mindepth 1 -maxdepth 1 -not \( -name 'jquery' -or -name 'vimeo-froogaloop2' \) | xargs rm -rf

# ***This is the line I've added***
# Add Amazon SES plugin

RUN cd /opt && COMPOSER_ALLOW_SUPERUSER=1 COMPOSER_PROCESS_TIMEOUT=10000 composer require pabloveintimilla/mautic-amazon-ses

FROM php:8.1-apache

COPY --from=builder /usr/local/lib/php/extensions /usr/local/lib/php/extensions

COPY --from=builder /usr/local/etc/php/conf.d/ /usr/local/etc/php/conf.d/
.... (continues)....

```

I’m new to php/composer. Not new to dev/docker.  
Howver, when I build, I get this error:

```auto
Step 13/38 : RUN cd /opt && COMPOSER_ALLOW_SUPERUSER=1 COMPOSER_PROCESS_TIMEOUT=10000 composer require pabloveintimilla/mautic-amazon-ses:^1.0.2
 ---> Running in 7b092418a272
./composer.json has been created
Running composer update pabloveintimilla/mautic-amazon-ses
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - mautic/core-lib[5.0.0, ..., 5.0.4] require friendsofsymfony/oauth-server-bundle dev-upgrade-2 -> found friendsofsymfony/oauth-server-bundle[dev-master, 1.0.0, ..., 1.7.x-dev, 2.0.0-alpha.0, 2.0.x-dev (alias of dev-master)] but it does not match the constraint.
    - pabloveintimilla/mautic-amazon-ses v1.0.2 requires mautic/core-lib ^5.0 -> satisfiable by mautic/core-lib[5.0.0, ..., 5.0.4].
    - Root composer.json requires pabloveintimilla/mautic-amazon-ses ^1.0.2 -> satisfiable by pabloveintimilla/mautic-amazon-ses[v1.0.2].

Installation failed, deleting ./composer.json.
The command '/bin/sh -c cd /opt && COMPOSER_ALLOW_SUPERUSER=1 COMPOSER_PROCESS_TIMEOUT=10000 composer require pabloveintimilla/mautic-amazon-ses:^1.0.2' returned a non-zero code: 2

```

I’ve tried specifying ^1.0.2 (as you can see above), or not, for the ses plugin version. No change to install behaviour. I’ve NOT tried installing as an actual service on bare metal, as that’s not really something I want to do in the long run.

I’m hoping to have a “simple” method to repetably build an SES capable image.

My fork is: [GitHub - scornflake/docker-mautic: Docker Image for Mautic](https://github.com/scornflake/docker-mautic)

Am I going about this the right way?

---

<div class="post-metadata">

**Author:** ![patryk.gruszka](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/patryk.gruszka/32/9813_2.png) [@patryk.gruszka](https://forum.mautic.org/u/patryk.gruszka)\
**Post date:** [June 7, 2024, 11:36am UTC](https://forum.mautic.org/t/trouble-adding-ses-plugin-to-a-dockerfile-so-i-can-build-my-own-image/32046/2 "2024-06-07T11:36:11Z")

</div>

I ran into similar issue with my plugin. I’m not sure if the version of [friendsofsymfony/oauth-server-bundle[dev-upgrade-2]](https://github.com/mautic/core-lib/blob/22326a56d902367022ef0a60015c223139d1ba38/composer.json#L72) is correct. @escopecz could you have a look?

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [June 7, 2024, 1:03pm UTC](https://forum.mautic.org/t/trouble-adding-ses-plugin-to-a-dockerfile-so-i-can-build-my-own-image/32046/3 "2024-06-07T13:03:54Z")

</div>

I don’t use SES so I’m not sure what version or plugin is the right one. I know that there are several for M5.

I have my own issues with plugin installation in Docker:

> <https://github.com/mautic/docker-mautic/issues/242>
>
> From default latest image mautic:v4-apache I believe that composer is not instal…led or supported. 
> 
> This should be part of default image as based on documentation I get this is going to be default way to install extensions.

---

<div class="post-metadata">

**Author:** ![patryk.gruszka](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/patryk.gruszka/32/9813_2.png) [@patryk.gruszka](https://forum.mautic.org/u/patryk.gruszka)\
**Post date:** [June 7, 2024, 1:20pm UTC](https://forum.mautic.org/t/trouble-adding-ses-plugin-to-a-dockerfile-so-i-can-build-my-own-image/32046/4 "2024-06-07T13:20:04Z")

</div>

Sorry, I was not precise. This problem will affect any plugin that depends on `mautic/core-lib`. I believe that the `dev-upgrade-2` version of the `oauth-server-bundle` specified in `mautic/core-lib` may no longer exist.

---

<div class="post-metadata">

**Author:** ![itnavigate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/itnavigate/32/12338_2.png) [@itnavigate](https://forum.mautic.org/u/itnavigate)\
**Post date:** [August 17, 2024, 8:05am UTC](https://forum.mautic.org/t/trouble-adding-ses-plugin-to-a-dockerfile-so-i-can-build-my-own-image/32046/5 "2024-08-17T08:05:33Z")

</div>

Not sure where you got to with this, but I have installed 5.1, and I didn’t install any additional plugins for SES. It just worked “Straight out of the box”.

---

<div class="post-metadata">

**Author:** ![christhonie](https://avatars.discourse-cdn.com/v4/letter/c/b4bc9f/32.png) [@christhonie](https://forum.mautic.org/u/christhonie)\
**Post date:** [August 22, 2024, 3:22pm UTC](https://forum.mautic.org/t/trouble-adding-ses-plugin-to-a-dockerfile-so-i-can-build-my-own-image/32046/6 "2024-08-22T15:22:34Z")

</div>

@patryk.gruszka , @scornflake, the error relating to `friendsofsymfony/oauth-server-bundle dev-upgrade-2` stems from the fact that `mautic/core-lib` defines its own repositories from where it resolves that dependency, as well as 2 others. Since Composer does not honour indirect/nested repository definitions, those must be redefined in your root `composer.php`.

Refer to [Mautic/composer.php](https://github.com/mautic/mautic/blob/0a68e13c4b0f32dec72857b01e306a1c33aad0f7/composer.json#L92).

However, you should to base your customisation on the `recommended-porject` ([GitHub](https://github.com/mautic/recommended-project) or [Packagist](https://packagist.org/packages/mautic/recommended-project)), as per the [Mautic 5 Dockerfile](https://github.com/mautic/docker-mautic/blob/084bcee5cc963379a8c519fe2fad4df8eeb37615/apache/Dockerfile#L59) approach. This will ensure those dependencies are added to your root `composer.php`, saving you from that headache.

---

<div class="post-metadata">

**Author:** ![christhonie](https://avatars.discourse-cdn.com/v4/letter/c/b4bc9f/32.png) [@christhonie](https://forum.mautic.org/u/christhonie)\
**Post date:** [August 22, 2024, 3:29pm UTC](https://forum.mautic.org/t/trouble-adding-ses-plugin-to-a-dockerfile-so-i-can-build-my-own-image/32046/7 "2024-08-22T15:29:47Z")

</div>

And if I am not mistaken, you need to add:

> “minimum-stability”: “dev”,  
> “prefer-stable”: true,
