Skip to content

Instantly share code, notes, and snippets.

@holms holms/Dockerfile
Created Sep 7, 2018

Embed
What would you like to do?
problem with volumes
FROM bitnami/minideb-extras:stretch-r131
LABEL maintainer "Bitnami <containers@bitnami.com>"
ENV BITNAMI_PKG_CHMOD="-R g+rwX" \
HOME="/"
# Install required system packages and dependencies
RUN install_packages libblkid1 libbsd0 libc6 libffi6 libgcc1 libglib2.0-0 libmount1 libpcre3 libselinux1 libstdc++6 libuuid1 libx11-6 libxau6 libxcb1 libxdmcp6 libxext6 zlib1g
RUN bitnami-pkg install java-1.8.181-1 --checksum 66bba4b4a2647f981339d306da796905c222057c4277a5ef045e079981a404f4
RUN bitnami-pkg unpack kafka-2.0.0-1 --checksum a5c583db6dce68f8c71e1f7bd3c927639ede08f8043cb699049041344c35449c
COPY rootfs /
ENV ALLOW_PLAINTEXT_LISTENER="no" \
BITNAMI_APP_NAME="kafka" \
BITNAMI_IMAGE_VERSION="2.0.0-debian-9-r5" \
KAFKA_ADVERTISED_LISTENERS="PLAINTEXT://:9092" \
KAFKA_BROKER_ID="-1" \
KAFKA_BROKER_PASSWORD="bitnami" \
KAFKA_BROKER_USER="user" \
KAFKA_CERTIFICATE_PASSWORD="" \
KAFKA_DELETE_TOPIC_ENABLE="false" \
KAFKA_HEAP_OPTS="-Xmx1024m -Xms1024m" \
KAFKA_INTER_BROKER_PASSWORD="bitnami" \
KAFKA_INTER_BROKER_USER="admin" \
KAFKA_LISTENERS="PLAINTEXT://:9092" \
KAFKA_LOGS_DIRS="/opt/bitnami/kafka/data" \
KAFKA_LOG_FLUSH_INTERVAL_MESSAGES="10000" \
KAFKA_LOG_FLUSH_INTERVAL_MS="1000" \
KAFKA_LOG_MESSAGE_FORMAT_VERSION="" \
KAFKA_LOG_RETENTION_BYTES="1073741824" \
KAFKA_LOG_RETENTION_CHECK_INTERVALS_MS="300000" \
KAFKA_LOG_RETENTION_HOURS="168" \
KAFKA_MAX_MESSAGE_BYTES="1000012" \
KAFKA_NUM_IO_THREADS="8" \
KAFKA_NUM_NETWORK_THREADS="3" \
KAFKA_NUM_PARTITIONS="1" \
KAFKA_NUM_RECOVERY_THREADS_PER_DATA_DIR="1" \
KAFKA_PORT_NUMBER="9092" \
KAFKA_SEGMENT_BYTES="1073741824" \
KAFKA_SOCKET_RECEIVE_BUFFER_BYTES="102400" \
KAFKA_SOCKET_REQUEST_MAX_BYTES="104857600" \
KAFKA_SOCKET_SEND_BUFFER_BYTES="102400" \
KAFKA_ZOOKEEPER_CONNECT="localhost:2181" \
KAFKA_ZOOKEEPER_CONNECT_TIMEOUT_MS="6000" \
KAFKA_ZOOKEEPER_PASSWORD="" \
KAFKA_ZOOKEEPER_USER="" \
PATH="/opt/bitnami/java/bin:/opt/bitnami/kafka/bin:$PATH"
EXPOSE 9092
RUN mkdir -p /bitnami/kafka
RUN chown -R 1001:1001 /bitnami/kafka
RUN chown -R 1001:1001 /opt/bitnami/kafka/
USER 1001
ENTRYPOINT [ "/app-entrypoint.sh" ]
CMD [ "/run.sh" ]
DOCKER_HOST=tcp://xxxxxx:2376 docker --tls stack deploy --compose-file=prod.dbs.yml --prune --with-registry-auth dbs
holms@debian ~/D/c/l/a/prod> docker --tls service logs -f dbs_kafka
dbs_kafka.1.vkh0nvk6bxah@swarm-slave-2 |
dbs_kafka.1.vkh0nvk6bxah@swarm-slave-2 | Welcome to the Bitnami kafka container
dbs_kafka.1.vkh0nvk6bxah@swarm-slave-2 | Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-kafka
dbs_kafka.1.vkh0nvk6bxah@swarm-slave-2 | Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-kafka/issues
dbs_kafka.1.vkh0nvk6bxah@swarm-slave-2 |
dbs_kafka.1.nra7fkzdenq3@swarm-slave-2 |
dbs_kafka.1.nra7fkzdenq3@swarm-slave-2 | Welcome to the Bitnami kafka container
dbs_kafka.1.nra7fkzdenq3@swarm-slave-2 | Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-kafka
dbs_kafka.1.nra7fkzdenq3@swarm-slave-2 | Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-kafka/issues
dbs_kafka.1.nra7fkzdenq3@swarm-slave-2 |
dbs_kafka.1.nra7fkzdenq3@swarm-slave-2 | WARN ==> You set the environment variable ALLOW_PLAINTEXT_LISTENER=yes. For safety reasons, do not use this flag in a production environment.
dbs_kafka.1.nra7fkzdenq3@swarm-slave-2 | nami INFO Initializing kafka
dbs_kafka.1.nra7fkzdenq3@swarm-slave-2 | Error executing 'postInstallation': EACCES: permission denied, lstat '/bitnami/kafka/data/lost+found'
holms@debian ~/D/c/l/a/prod> ssh root@swarm-slave-2
# docker exec -it b519df16cf4d /bin/bash
I have no name!@b519df16cf4d:/bitnami$ ls -n
total 8
drwxrwxr-x 1 0 0 4096 Sep 7 18:07 java
drwx------ 4 0 0 4096 Sep 7 17:35 kafka
# entering hat folder says permission denied.
version: '3.7'
x-placement:
&default-placement
constraints:
- node.role == worker
preferences:
- spread: node.role == worker
services:
redis:
image: redis:3-alpine
networks:
- redis
deploy:
mode: replicated
replicas: 2
placement: *default-placement
zookeeper:
image: holms/bitnami-docker-zookeeper:latest
networks:
- zookeeper
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
volumes:
- zookeeper:/bitnami/zookeeper
deploy:
placement: *default-placement
kafka:
image: holms/bitnami-docker-kafka:latest
networks:
- zookeeper
- kafka
volumes:
- kafka:/bitnami/kafka
command: sleep 5d
depends_on:
- zookeeper
environment:
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
deploy:
placement: *default-placement
volumes:
zookeeper:
driver: rexray
kafka:
driver: rexray
networks:
redis:
driver: overlay
kafka:
driver: overlay
zookeeper:
driver: overlay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.