Docker - Using Local Image


Hi, is there a way to use a local image without publish it to docker store or docker hub?

something like - image: ./.circleci/myLocalImageFolder/Dockerfile

sometimes you need the language image and the other dependecies (Ex: NodeJs)


This is interesting idea. I’m afraid though it can increase build times so that you can’t really benefit from super fast image fetch + start of the 2.0 platform.


We’d still have to pull in your code and build your image. You can already do that with multiple jobs, though I realize the versioning of the image could cause a problem. Maybe you need to add the sha and sed it on each build, or something more clever.

Here is the docs for multiple jobs:

FROM microsoft/dotnet:latest
RUN apt-get install npm


- image: microsoft/dotnet:latest
- run: apt-get install npm

It seems the same but, but if I am using two or more containers i cant give commands to the ‘not first container’. With this, i can have all the dependencies ready in a container and have two databases in the same postgres database, for example.


I recommend against using the “latest” tag for consistency reasons.

You can specify the cmd in which it executes. You should be able to pass whatever you need there.


yeah, i know that latest is bad, only say it as example.

Are you saying that i can execute more than one command?

- image: anyImage:anyTag
  command: [ mycomand ]

Then, how can i execute more than one command?


Oh-sorry. Don’t mean to nitpick :slight_smile:

For multiple commands, you should be able to use

- image: anyImage:anyTag
  command: [ "mycomand", "&&", "command2" ]


Thanks roharab i will have this in consideration.

But i will be nice to have the ability to use local dockerfiles wihout the need of publish it to hub.docker or store.docker


So, it is going to be implemented this in the future?


I have my doubts but it’s only been 5 days since you opened this; no updates yet.

For what it is worth, it’s not really the Docker way. It would be cool, though.


If you need it, i can write a proposal with: use cases, benefits, inconventients, examples, etc…