# Build temporal server image from scratch

**URL:** <https://community.temporal.io/t/build-temporal-server-image-from-scratch/5262>\
**Category:** Community Support\
**Tags:** server\
**Created:** [July 8, 2022, 10:53am UTC](https://community.temporal.io/t/build-temporal-server-image-from-scratch/5262 "2022-07-08T10:53:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pradnya.bhalekar](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@pradnya.bhalekar](https://community.temporal.io/u/pradnya.bhalekar)\
**Post date:** [July 8, 2022, 10:53am UTC](https://community.temporal.io/t/build-temporal-server-image-from-scratch/5262/1 "2022-07-08T10:53:39Z")

</div>

HI, Being in a corporate setup, the base temporal server image temporalio/auto-setup, cannot be used, because it may be exposed to security vulnerabilities.

Instead , i want to build the server image by myself, so that i can control ,what goes into the image.

For that , plz guide me to the base source and base Dockerfile and other artifacts/documents to get started

---

<div class="post-metadata">

**Author:** ![jreynolds23](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/jreynolds23/32/1998_2.png) [@jreynolds23](https://community.temporal.io/u/jreynolds23)\
**Post date:** [July 8, 2022, 2:27pm UTC](https://community.temporal.io/t/build-temporal-server-image-from-scratch/5262/3 "2022-07-08T14:27:37Z")

</div>

Hey Pradnya,

Please follow this docker build repo from: [GitHub - temporalio/docker-builds: Temporal service Docker images build](https://github.com/temporalio/docker-builds) to guide you on building a base Dockerfile.

---

<div class="post-metadata">

**Author:** ![pradnya.bhalekar](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@pradnya.bhalekar](https://community.temporal.io/u/pradnya.bhalekar)\
**Post date:** [July 11, 2022, 5:46am UTC](https://community.temporal.io/t/build-temporal-server-image-from-scratch/5262/4 "2022-07-11T05:46:45Z")

</div>

i cloned the repo and in the docker-builds folder i give the command

docker build . -f admin-tools.Dockerfile -t temporalio/admin-tools:pradnya07112022 --build-arg SERVER\_IMAGE=temporalio/server:latest

i get this error:

## =\> ERROR [admin-tools-builder 3/6] COPY ./temporal/go.mod ./temporal/go.sum ./temporal/ 0.0s

> [admin-tools-builder 3/6] COPY ./temporal/go.mod ./temporal/go.sum ./temporal/:

* * *

failed to compute cache key: “/temporal/go.sum” not found: not found

plz help

---

<div class="post-metadata">

**Author:** ![jreynolds23](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/jreynolds23/32/1998_2.png) [@jreynolds23](https://community.temporal.io/u/jreynolds23)\
**Post date:** [July 12, 2022, 5:53pm UTC](https://community.temporal.io/t/build-temporal-server-image-from-scratch/5262/5 "2022-07-12T17:53:57Z")

</div>

The admin-tools image needs temporal itself in order to build the sql tools. If you look at the docker file [docker-builds/admin-tools.Dockerfile at main · temporalio/docker-builds · GitHub](https://github.com/temporalio/docker-builds/blob/main/admin-tools.Dockerfile#L12)  
it expects temporal server code to be in the “temporal” directory.

So what you can do is:  
cd docker-builds  
git clone [git@github.com](mailto:git@github.com):temporalio/temporal.git

This will add temporal server code in /temporal directory and then run your command again which should allow you to build your image.
