Light4J Oauth2 docker-compose error's saying Cannot locate specified Dockerfile

84 views Asked by At

Followed what was given in the documentation about running light4J oAuth locally. I was able to run maven clean install on the whole repo but when i try running the docker compose up it fails saying DockerFile does not exist. Below is the main repository of the light4J oAuth repo. https://github.com/networknt/light-oauth2

The documentation steps followed. https://doc.networknt.com/getting-started/light-oauth2/

Ran "mvn clean install" followed by "docker-compose -f docker-compose-mysql.yml up". Gives the following error. "ERROR: Cannot locate specified Dockerfile: Dockerfile".

Following is the docker installation on mac. docker-installtion-on-mac-local

If anyone knows what might be the problem and direct me to the right direction that would be awesome. Thanks.

1

There are 1 answers

0
agentsmith On BEST ANSWER

I had a look at your repository. It seems like your Dockerfile is located under code/docker, service/docker, etc. instead of just code/, service/, etc.

See the build for more information.

build can be specified either as a string containing a path to the build context: Example for docker-docs

version: "3.8"
services:
  webapp:
    build:
      context: ./dir
      dockerfile: Dockerfile-alternate
      args:
        buildno: 1

Try this instead (example for one of your containers)

 oauth2-code:
      build: 
         context: ./code/docker
         dockerfile: Dockerfile # Not mandatory
[...]