Comments (3)
Hello,
I had the same problem and struggled with this way too long.
The probleme is that you add an init file to /docker-entrypoint-initdb.d : if you look at the Dockerfile of postgres, you will see that this docker-entrypoint launch your init files before using timescaledb as a dependency !
In order to fix that, I created another container, expecially for the init of the db, it looks like this :
FROM debian:jessie
RUN apt-get update && apt-get install -y netcat
# in order to have psql
RUN apt-get install -y postgresql-client
ADD ./init_schema.sql /
ADD ./start.sh /start.sh
CMD ["/start.sh"]
and the start.sh looks like this :
#!/bin/sh
while ! nc -z postgres 5432;do sleep 3;done
# now that the database is up, we can log into it and launch the init
PGPASSWORD=my password psql -h name_in_docker_compose -U user database< init_schema.sql
echo 'init done'
The part with the while is here to be sure the database is up before filling it with data.
version: '3'
services:
postgres:
build:
context: ./postgres
container_name: postgres
postgres_init:
build:
context: ./postgres/postgres_init
container_name: postgres_init
depends_on:
- postgres
I also put the command "postgres -c shared_preload_libraries=timescaledb" in the dockerfile as CMD [...] instead of the docker-compose.
This workaround works but it is not really clean, I admit, but it works until we find something better.
from timescaledb.
Hi, we just released a new version (0.0.12-beta) that also included a new build process for Docker images (using the timescale/timescaledb-docker repo). This should have streamlined the build image, so maybe give it a try and see if it works better with Docker Compose? If not we can do some more investigating.
from timescaledb.
I tested it today, it works perfectly, good job. Now you can add you init scripts to /docker-entrypoint-initdb.d in the timescaledb docker, postgres will use it correctly (without saying that it can't use plugin timescaledb or whatever)
from timescaledb.
Related Issues (20)
- [Bug]: Upgrade Version From 2.10.1 To 2.14.2 Failing With Error Constraint Foreign Key on bgw_job_stat tables HOT 4
- [Feature]: RLS for hypertables with compression
- [Bug]: Dependency tracking of hierarchical caggs HOT 5
- [Bug]: Upgrade Version From 2.10.1 To 2.14.2 Failing With loader version out-of-date HOT 5
- [Feature]: caggs on top of tables with RLS enabled
- [Feature]: Force refresh continious aggregate
- [Bug]: create_hypertable(..., migrate_data=>true) doesn't create a valid partition index
- [Bug] Unneeded sorting of compressed chunk table with aggregation
- [Bug]: Decompression doesn't handle visibility properly
- [Bug]: Compression doesn't handle visibility correctly
- [Bug]: time_bucket_gapfill with named timezone gives incorrect result HOT 9
- [Bug]: Running concurrent tests on a TimescaleDB instance HOT 5
- [Bug]: Compression leads to corrupt table HOT 4
- [Bug]: Before Update trigger on hypertable make updates fail HOT 4
- [Bug]: Slow query when trying to retrieve tuples used in chunk segmentation HOT 2
- Deleting compressed cagg does not delete compression settings of cagg
- [Bug]: ORDER/GROUP BY expression not found in targetlist HOT 1
- [Bug]: Cannot create hypertable when set search_path to false HOT 1
- [Bug]: Segmentation fault with time_bucket query HOT 1
- [Bug]: NaN behavior changes in compressed tables HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timescaledb.