Hi I Have trying to run NIFI Apache on Docker using the DockerFile but i got error just like i attached in the Picture, is there any settings missing on the DockerFile?.
my Docker Compose File
version: '3.5'
services:
nifi:
build:
context: .
dockerfile: Dockerfile
args:
NIFI_VERSION: 1.8.0
http_proxy: ${http_proxy}
https_proxy: ${https_proxy}
ports:
- "8080:8080"
volumes:
- ./config/nifi/conf:/opt/nifi/nifi-current/conf
- ./config/nifi/data:/home/nifi/data/data
- ./config/nifi/script:/home/nifi/data/script
- ./config/nifi/utils:/home/nifi/data/utils
nifi-registry:
build:
context: .
dockerfile: Dockerfile.registry
args:
NIFI-REGISTRY-VERSION: 0.3.0
http_proxy: ${http_proxy}
https_proxy: ${https_proxy}
ports:
- "18080:18080"
volumes:
- ./config/nifi-registry/conf:/opt/nifi-registry/nifi-registry-0.3.0/conf
- ./config/nifi-registry/flow_storage:/opt/nifi-registry/nifi-registry-0.3.0/flow_storage
- ./config/nifi-registry/database/:/opt/nifi-registry/nifi-registry-0.3.0/database
screenshot
(sorry, can't comment yet, so I'm popping an answer)
Your log file says '/opt/nifi/nifi-current/logs/nifi-app.log' can't be open. Could it be a problem with your configuration file ?
Related
This is my Docker Compose file containing 4 api containers:
version: '3.4'
services:
api1.api:
image: ${DOCKER_REGISTRY-}api1
build:
context: .
dockerfile: Api1.Api/Dockerfile
networks:
- dev-network
ports:
- "62000:443"
- "62001:80"
api2.api:
image: ${DOCKER_REGISTRY-}api2
build:
context: .
dockerfile: Api2.Api/Dockerfile
networks:
- dev-network
ports:
- "62002:443"
- "62003:80"
api3.api:
image: ${DOCKER_REGISTRY-}api3
build:
context: .
dockerfile: Api3.Api/Dockerfile
networks:
- dev-network
ports:
- "62004:443"
- "62005:80"
api4.api:
image: ${DOCKER_REGISTRY-}api4
build:
context: .
dockerfile: Api4.Api/Dockerfile
networks:
- dev-network
ports:
- "62006:443"
- "62007:80"
networks:
dev-network:
name: dev-network
I have set the ports but when I run docker-compose up -d, the results are that either 1 or 2 of the apis will have the specified ports only. The rest will be randomly generated or even blank.
I have to manually restart that container before it generates a random port.
Am I missing a command or step? How can I get my docker-compose to follow the ports that have been set?
This is my docker_compose:
version: '3.7'
services:
app:
command: run
build:
context: .
dockerfile: Dockerfile.dev
image: test/testapi-configuration
ports:
- '5005:5005'
- '8080:8080'
volumes:
- './:/source:rw'
- '~/.vault_token:/root/.vault_token'
localstack:
image: localstack/localstack
ports:
- '4566:4566'
environment:
- SERVICES=dynamodb
- DEBUG=1
- DATA_DIR=/tmp/localstack/data
- DEFAULT_REGION=us-east-2
volumes:
- './.localstack:/tmp/localstack'
- '/var/run/docker.sock:/var/run/docker.sock'
My dockerfile.dev:
WORKDIR /source
ENTRYPOINT ["./gradlew"]
EXPOSE 5005
I set up my app running with:
localstack start
Then I run my api in the IntelliJ IDE, y create the table in the dynamoDb with:
aws dynamodb --endpoint-url=http://localhost:4566 --region=us-east-2 create-table --cli-input-json file://file_example.json
But I cant get to use the dynamodb-admin tool working.
Docs here: https://www.npmjs.com/package/dynamodb-admin
I understand that I have to execute:
DYNAMO_ENDPOINT=http://localhost:8080 dynamodb-admin -p 4566
But ive got following error:
UnknownError: 405
at Request.extractError (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/protocol/json.js:52:27)
at Request.callListeners (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/request.js:686:14)
at Request.transition (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/request.js:688:12)
at Request.callListeners (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
The right way to do it was:
docker-compose up localstack
I want to spin up two containers when I do docker-compose up
I have two folders API and front. Each has a Dockerfile and docker-compose file. currently, I have to do docker-compose up for each app.
like below
- api
- docker-compose.yml
- Dockerfile
- front
- docker-compose.yml
- Dockerfile
I want to have one docker-compose.yml to manage two containers like below.
- docker-compose.yml
- api
- Dockerfile
- front
- Dockerfile
api docker-compose
version: '3'
services:
api:
build: .
command: pipenv run start
image : data-tracker-backend
volumes:
- .:/api/
ports:
- "8000:8000"
front docker-compose
version: '3'
services:
web:
build: .
command: npm start
image : data-tracker-front
volumes:
- .:/front/
ports:
- "5000:5000"
I want to have something like
version: '3'
services:
api:
build: .
command: pipenv run start
image : data-tracker-backend
volumes:
- .:/api/
ports:
- "8000:8000"
front:
build: .
command: npm start
image : data-tracker-front
volumes:
- .:/front/
ports:
- "5000:5000"
help to access the command from the different working directories.
You can change the build directory and the volumes one.
version: '3'
services:
api:
build: ./api
volumes:
- ./api:/api
# the rest of your commands...
front:
build: ./front
volumes:
- ./front:/front
# the rest of your commands...
My suggestion though is to read the guidelines. It's plenty of information and tutorials there.
You can try to use build context and dockerfile as shown below
- docker-compose.yml
- api
- Dockerfile
- front
- Dockerfile
version: '3'
services:
api:
build:
context: api
dockerfile: Dockerfile
command: pipenv run start
image : data-tracker-backend
volumes:
- .:/api/
ports:
- "8000:8000"
front:
build:
context: front
dockerfile: Dockerfile
command: npm start
image : data-tracker-front
volumes:
- .:/front/
ports:
- "5000:5000"
I have the error message:
ERROR: for webapi No such image: sha256:58e2b174484ca40a99ec559bcf6421811d4532cbe009f89d08d430eae9f27050
ERROR: Encountered errors while bringing up the project.
After run commands in Docker Quickstart Terminal:
docker-compose build
docker-compose up -d
It looks like some problems with my image, but I can't find where I should find it. It's built normal and it's throw exception while running my image.
My docker-compose.yml:
version: '2'
services:
webapi:
image: clientpanel
build:
context: ./src/WebApi
dockerfile: Dockerfile
links:
- mongodb
- rabbit
ports:
- "9183:9183"
mongodb:
image: mongo
ports:
- "27017:27017"
rabbit:
container_name: dev_rabbit
hostname: localhost
image: rabbitmq:3.6.8-management
environment:
CLUSTERED: "true"
RABBITMQ_DEFAULT_USER: "guest"
RABBITMQ_DEFAULT_PASS: "guest"
RABBITMQ_DEFAULT_VHOST: "/"
ports:
- "5672:5672"
- "15672:15672"
And my Dockerfile
FROM microsoft/aspnetcore:1.1
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "WebApi.dll"]
Remove the stopped service containers using docker-compose rm and then try docker-compose up.
We can see the service containers using docker-compose ps.
I have two docker-compose.yml files in separate folders.
I'd like to run the two of them in the same command, in order for the services from both to be able to talk to each other.
However, when I go to the lowest common path ancestor and try to run docker-compose with both files, here is what happens:
$ docker-compose -f ./api-folder/docker-compose.yml -f ./front-folder/docker-compose.yml up -d
ERROR: build path /projects/front-folder/api either does not exist, is not accessible, or is not a valid URL.
$ docker-compose -f ./front-folder/docker-compose.yml -f ./api-folder/docker-compose.yml up -d
ERROR: build path /projects/api-folder/app either does not exist, is not accessible, or is not a valid URL.
Here are the two docker-compose.yml files:
/projects/front-folder/docker-compose.yml
version: '2'
services:
app:
restart: always
build: ./app
environment:
NODE_ENV: 'dev'
ports:
- "4400:4400"
volumes:
- ./app:/usr/src/app
nginx:
restart: always
build: ./nginx
volumes:
- ./logs:/usr/local/var/log/nginx
links:
- app
ports:
- "80:80"
/projects/api-folder/docker-compose.yml
version: '2'
services:
api:
restart: always
build: ./api
expose:
- "4600"
volumes:
- ./api:/usr/src/app
- ./logs:/logs
nginx:
restart: always
build: ./nginx
volumes:
- ./logs:/usr/local/var/log/nginx
links:
- api
ports:
- "81:80"
networks:
- hackerz
And the directory structure:
- /projects
- /front-folder
- /app
Dockerfile
- /nginx
Dockerfile
docker-compose.yml
- /api-folder
- /api
Dockerfile
- /nginx
Dockerfile
docker-compose.yml
I'm guessing the problem is with the build paths, but what I don't understand is:
Why Docker insists on searching build: ./api in /front-folder or the other way around?
How to circumvent this problem and be able to run both files together?
DOCKERFILE
Alternate Dockerfile.
Compose uses an alternate file to build with. A build path must also be specified.
service3:
build:
context: .
dockerfile: Dockerfile-alternate
docker compose build giving custom file
This isn't how compose works (by design). See my comment here: https://github.com/docker/compose/issues/3530#issuecomment-222490501.