Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-23-2020 06:07 AM
Hi - I'm trying to create a docker image that will support Neo4j and Golang. Here is my Dockerfile
'''
FROM neo4j:latest
MAINTAINER dmazzoni davem@ltsnet.net
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install -y build-essential
FROM golang:latest
RUN apt-get update
RUN apt-get -y install vim
RUN apt-get -y install wget
CMD wget golang.org/dl/go1.14.6.linux-amd64.tar.gz
CMD tar -C /usr/local -xf go1.14.6.linux-amd64.tar.gz
#docker build .
'''
I can start this and it looks good with go, but I don't know how to get neo4j 'working'.
My goal is to use neoj4 with go using a docker image.
Any suggestions? Am I starting it the wrong way (docker run -it golangneo4j /bin/bash)?
Thanks!
07-24-2020 02:05 AM
Disclaimer: Not an expert in Docker
You could just create a script file and put it into the image (or call the script directly in the build file):
There is for certain something to optimize in the waiting but since there is no netcat
in the image you have to live with what is there
#!/bin/bash
neo4j-admin set-initial-password "secret"
neo4j start
until (exec 3<>/dev/tcp/127.0.0.1/7687) &>/dev/null; do
echo "Try again"
sleep 1s
done
<your execution>
If you do not want to execute anything, you could just ignore the waiting and all the stuff.
07-24-2020 02:07 AM
Thanks for the reply. Actually I got the neo4j example/docker to run. Can I extend it (another pull -- day Ubuntu or golang) and still run the same startup?
07-24-2020 03:25 AM
This is the moment my knowledge ends.
07-24-2020 05:25 AM
Thanks anyway.
Have a great weekend!
09-14-2020 12:43 PM
I have recently uploaded an example as a "proof of concept" using Golang, gqlgen and Docker; you can find it here.
Cheers
All the sessions of the conference are now available online