Code Monkey home page Code Monkey logo

docker's Introduction

Tarantool Docker images

What is Tarantool

Tarantool is an in-memory computing platform that combines a Lua application server and a database management system. Read more about Tarantool at tarantool.io.

Quick start

To try out Tarantool, run this command:

$ docker run --rm -t -i tarantool/tarantool

It will create a one-off Tarantool instance and open an interactive console. From there, you can either type tutorial() in the console or follow the documentation.

What's on board

The tarantool/tarantool images contain the Tarantool executable and a combination of Lua modules and utilities often used in production. Designed as a building block for modern services, these modules and utilities are based on a few design choices that set them apart from the systemd-controlled Tarantool. We check all these extensions for compatibility with the Tarantool version included in the image.

The Docker images come in three flavors, based on three different images: alpine:3.15, centos:7 and ubuntu:20.04. Check them out:

$ docker run --rm -t -i tarantool/tarantool:2.10.0
$ docker run --rm -t -i tarantool/tarantool:2.10.0-centos7
$ docker run --rm -t -i tarantool/tarantool:2.10.0-ubuntu

The entrypoint script in each of these images uses environment variables to set various configuration options, such as replication sources, memory limits, and so on. If specified, the environment variables override the settings provided in your code. This way, you can set options using docker compose or other orchestration and deployment tools.

There are also a few convenience tools that make use of the fact that there is only one Tarantool instance running in the container.

Included modules

The following Lua modules are included in the build:

  • avro-schema: Apache Avro scheme for your data.
  • connpool: Keep a pool of connections to other Tarantool instances.
  • curl: HTTP client based on libcurl.
  • expirationd: Automatically delete tuples based on expiration time.
  • gis: Store and query geospatial data.
  • gperftools: Collect a CPU profile to find bottlenecks in your code.
  • http: Embedded HTTP server with Flask-style routing support.
  • memcached: Access Tarantool as if it was a memcached instance.
  • metrics: Metric collection library for Tarantool.
  • mqtt: Client for MQTT message brokers.
  • mysql: Query MySQL right from Tarantool.
  • pg: Query PostgreSQL right from Tarantool.
  • prometheus: Instrument code and export metrics to Prometheus monitoring.
  • queue: Priority queues with TTL and confirmations.
  • vshard: Automatically distribute data across multiple instances.

If the module you need is not listed here, there is a good chance we can add it. Open an issue on our GitHub.

Data directories

Mount these directories as volumes:

  • /var/lib/tarantool contains operational data (snapshots, xlogs and vinyl runs).

  • /opt/tarantool is the directory for Lua application code.

Convenience tools

  • console: Execute without arguments to open an administrative console to a running Tarantool instance.

  • tarantool_is_up: Returns 0 if Tarantool has been initialized and is operating normally.

  • tarantool_set_config.lua: Allows you to dynamically change certain settings without the need to recreate containers.

Versions, tags, and release policy

The images are built and published on Docker Hub for each Tarantool release as well as for some beta and release candidate versions.

There are three variants built from different base images:

  • Alpine 3.15, the "default" build with tags having no mention of base image, like latest, 1, 2, 1.10,1.10.z, 2.y, 2.y.z and others.
  • CentOS 7 with tags like 1-centos7, 2-centos7, and so on.
  • Ubuntu 20.04 with tags like 1-ubuntu22.04, 2-ubuntu22.04, and so on.

How to use these images

Start a Tarantool instance

$ docker run \
  --name mytarantool \
  -p 3301:3301 -d \
  tarantool/tarantool

This will start an instance of Tarantool and expose it on port 3301. Note that by default there is no password protection, so don't expose this instance to the outside world.

In this case, as there is no Lua code provided, the entrypoint script initializes the database using a reasonable set of defaults. Some of them can be tweaked with environment variables (see below).

Start a secure Tarantool instance

$ docker run \
  --name mytarantool \
  -p 3301:3301 \
  -e TARANTOOL_USER_NAME=myusername \
  -e TARANTOOL_USER_PASSWORD=mysecretpassword -d \
  tarantool/tarantool

This starts an instance of Tarantool, disables guest login, and creates a user named myusername with admin privileges and the password mysecretpassword.

As in the previous example, the database is initialized automatically.

Connect to a running Tarantool instance

$ docker exec -t -i mytarantool console

This will open an interactive admin console on the running instance named mytarantool. You can safely detach from it anytime, the server will continue running.

This console doesn't require authentication, because it uses a local Unix socket in the container to connect to Tarantool. However, it requires you to have direct access to the container.

If you need to access a remote console via TCP/IP, use the tt utility as explained here.

Start a master-master replica set

You can start a replica set with Docker alone, but it's more convenient to use docker-compose. Here's a simplified docker-compose.yml for starting a master-master replica set:

version: '2'

services:
  tarantool1:
    image: tarantool/tarantool:latest
    environment:
      TARANTOOL_REPLICATION: "tarantool1,tarantool2"
    networks:
      - mynet
    ports:
      - "3301:3301"

  tarantool2:
    image: tarantool/tarantool:latest
    environment:
      TARANTOOL_REPLICATION: "tarantool1,tarantool2"
    networks:
      - mynet
    ports:
      - "3302:3301"

networks:
  mynet:
    driver: bridge

Start it like this:

$ docker compose up

Add application code with a volume mount

The simplest way to provide application code is to mount your code directory to /opt/tarantool:

$ docker run \
  --name mytarantool \
  -p 3301:3301 -d \
  -v /path/to/my/app:/opt/tarantool \
  tarantool/tarantool \
  tarantool /opt/tarantool/app.lua

Here, /path/to/my/app is the host directory containing Lua code and app.lua is the entry point of your application. Note that for your code to run, you must execute the main script explicitly, which is done in the last line.

Build your own images

To pack and distribute an image with your code, create your own Dockerfile:

FROM tarantool/tarantool:2.10.0
COPY app.lua /opt/tarantool
CMD ["tarantool", "/opt/tarantool/app.lua"]

Then build it with:

$ docker build -t company/appname:tag .

Please pay attention to the format of CMD. Unless it is specified in square brackets, the wrapper entrypoint that our Docker image provides will not be called. In this case, you will not be able to configure your instance using environment variables.

We recommend building from an image with a precise tag, that is, 2.10.0 or 2.10.0-centos7, not 2.10 or latest. This way you will have more control over the updates of Tarantool and other dependencies of your application.

Environment variables

When you run this image, you can adjust some of Tarantool settings. Most of them either control memory/disk limits or specify external connectivity parameters.

If you need to fine-tune specific settings not described here, you can always inherit this container and call box.cfg{} yourself. See the documentation on box.cfg for details.

TARANTOOL_USER_NAME

Setting this variable allows you to pick the name of the user that is utilized for remote connections. By default, it is guest. Please note that since the guest user in Tarantool can't have a password, it is highly recommended that you change it.

TARANTOOL_USER_PASSWORD

For security reasons, it is recommended that you never leave this variable unset. This environment variable sets the user's password for Tarantool. In the above example, it is set to mysecretpassword.

TARANTOOL_PORT

Optional. Specifying this variable will tell Tarantool to listen for incoming connections on a specific port. Default is 3301.

TARANTOOL_PROMETHEUS_DEFAULT_METRICS_PORT

Optional. If specified, Tarantool will start an HTTP server on the provided port and expose the Prometheus metrics endpoint with common metrics (fibers, memory, network, replication, etc.).

TARANTOOL_REPLICATION

Optional. Comma-separated list of URIs to treat as replication sources. Upon start, Tarantool will attempt to connect to those instances, fetch the data snapshot, and start replicating transaction logs. In other words, it will become a slave. For a multi-master configuration, other participating instances of Tarantool should be started with the same TARANTOOL_REPLICATION. (NB: Applicable only to versions later than 1.7.)

Example:

user1:pass@host1:3301,user2:pass@host2:3301

TARANTOOL_MEMTX_MEMORY

Optional. Specifies how much memory Tarantool allocates to actually store tuples, in bytes. When the limit is reached, INSERT or UPDATE requests begin failing. Default is 268435456 (256 megabytes).

TARANTOOL_SLAB_ALLOC_FACTOR

Optional. Used as the multiplier for computing the sizes of memory chunks that tuples are stored in. A lower value may result in less wasted memory, depending on the total amount of memory available and the distribution of item sizes. Default is 1.05.

TARANTOOL_MEMTX_MAX_TUPLE_SIZE

Optional. Size of the largest allocation unit in bytes. It can be increased if it is necessary to store large tuples. Default is 1048576.

TARANTOOL_MEMTX_MIN_TUPLE_SIZE

Optional. Size of the smallest allocation unit, in bytes. It can be decreased if most of the tuples are very small. Default is 16.

TARANTOOL_CHECKPOINT_INTERVAL

Optional. Specifies how often snapshots are made, in seconds. Default is 3600 (every 1 hour).

TARANTOOL_FORCE_RECOVERY

Optional. When set to true, Tarantool tries to continue if there is an error while reading a snapshot file or a write-ahead log file. Skips invalid records, reads as much data as possible, print a warning in console and start the database.

TARANTOOL_LOG_FORMAT

Optional. There are two possible log formats:

  • 'plain' โ€” the default one.
  • 'json' โ€” with more details and with JSON labels.

More details can be found in the log module reference.

TARANTOOL_LOG_LEVEL

Optional. Default value is 5 (that means INFO). More details can be found in log level configuration.

Contributing

Reporting problems and getting help

You can report problems and request features on our GitHub.

Alternatively, you may get help on our Telegram channel.

How to contribute

Open a pull request to the master branch. A maintainer is responsible for merging the PR.

How to check

Say, we have updated 'dockerfiles/alpine_3.9' and want to check it:

$ TAG=2 OS=alpine DIST=3.9 VER=2.x PORT=5200 make -f .github.mk build
$ docker run -it tarantool/tarantool:2
...perform a test...

Build pipelines

Fixed release versions:

Docker tag FROM Dockerfile
2.10.0 alpine:3.15 dockerfile/alpine_3.15
2.10.0-centos7 centos:7 dockerfile/centos_7
2.10.0-ubuntu20.04 ubuntu:20.04 dockerfile/ubuntu_20.04
2.10.0-rc1 alpine:3.9 dockerfile/alpine_3.9
2.10.0-beta2 alpine:3.9 dockerfile/alpine_3.9
2.10.0-beta1 alpine:3.9 dockerfile/alpine_3.9
2.8.0 .. 2.8.4 alpine:3.9 dockerfile/alpine_3.9
2.7.0 .. 2.7.3 alpine:3.9 dockerfile/alpine_3.9
2.6.0 .. 2.6.3 alpine:3.9 dockerfile/alpine_3.9
2.5.0 .. 2.5.3 alpine:3.9 dockerfile/alpine_3.9
2.4.0 .. 2.4.3 alpine:3.9 dockerfile/alpine_3.9
2.3.1 .. 2.3.3 alpine:3.9 dockerfile/alpine_3.9
2.3.0 alpine:3.5 dockerfile/alpine_3.5
2.2.2 .. 2.2.3 alpine:3.9 dockerfile/alpine_3.9
2.2.0 .. 2.2.1 alpine:3.5 dockerfile/alpine_3.5
2.1.3 alpine:3.9 dockerfile/alpine_3.9
2.1.0 .. 2.1.2 alpine:3.9 dockerfile/alpine_3.5
1.10.13 alpine:3.9 dockerfile/alpine_3.9
1.10.4 .. 1.10.12 alpine:3.9 dockerfile/alpine_3.9
1.10.0 .. 1.10.3 alpine:3.5 dockerfile/alpine_3.5

Rolling versions:

Docker tag Dockerfile
2, latest dockerfile/alpine_3.15
2-centos7 dockerfile/centos_7
1 dockerfile/alpine_3.15
1 dockerfile/alpine_3.15
2.1 .. 2.8 dockerfile/alpine_3.9
2.1 .. 2.8 dockerfile/alpine_3.9

Special builds:

Docker tag Dockerfile
2.10.0-centos7 dockerfile/centos_7
2.10.0-ubuntu dockerfile/ubuntu_20.04
1.x-centos7 dockerfile/centos_7
2.x-centos7 dockerfile/centos_7

Release policy

All images are pushed to Docker Hub.

Fixed version tags (x.y.z) are frozen: we never update them.

Example of versions timeline for Tarantool since 2.10 (see the release policy):

  • 2.10.0-beta1 โ€” Beta
    • 2.10.0-rc1 โ€” Release candidate
      • 2.10.0 โ€” Release (stable)

Example of minor versions timeline for Tarantool up to 2.8:

  • x.y.0 - Alpha
    • x.y.1 - Beta
      • x.y.2 - Stable
        • x.y.3 - Stable

Rolling versions are updated to the latest release (stable) versions:

  • x.y == x.y.latest-z (== means 'points to the same image')
  • 1 == 1.10.latest-z
  • 2 == 2.latest-y.z
  • latest == 2

Special stable builds (CentOS) are updated with the same policy as rolling versions:

  • 1.x-centos7 image offers a last 1.<last-y>.2 release
  • 2.x-centos7 image offers a last 2.<last-y>.2 release

Exceptional cases

As an exception we can deliver an important update for the existing tarantool release within x.y.z-r1, x.y.z-r2, ... tags.

When x.y.z-r<N> is released, the corresponding rolling releases (x.y, x and latest if x == 2) should be updated to point to the same image.

There is no strict policy, which updates should be considered important. Let's decide on demand and define the policy later.

TBD: How to notify users about the exceptional updates?

How to build and push an image

Example:

$ export TAG=2
$ export OS=alpine DIST=3.9 VER=2.x  # double check the values!
$ PORT=5200 make -f .github.mk build
$ docker push tarantool/tarantool:${TAG}

docker's People

Contributors

amdrozdov avatar andreyaksenov avatar artembo avatar avtikhon avatar bigbes avatar dedok avatar foxzi avatar inwady avatar kasen avatar kostja avatar kyukhin avatar laserphaser avatar mebelousov avatar nekufa avatar nickvolynkin avatar olegrok avatar opomuc avatar patiencedaur avatar rom325 avatar rosik avatar rtsisyk avatar rybakit avatar sharonovd avatar sosiska avatar totktonada avatar vasiliy-t avatar vitaliyaioffe avatar vr009 avatar ylobankov avatar yngvar-antonsson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker's Issues

Add HEALTHCHECK in docker container.

Healthcheck should return "healthy" if tarantool is ready to accept incoming connections.

Would be great if it can be replaced and/or customized: e.g. X of replication source are available.

tarantool/tarantool:1.9

Please add tag for tarantool 1.9
docker run --rm -t -i tarantool/tarantool:1.9

It's very unclear when there is tag `tarantool/tarantool:1.7``, but no 1.9

I could found answer in telegram channel only how to get TT 1.9:
docker run --rm -t -i tarantool/tarantool:1

Unable to run master-master replica in Docker Swarm

Same issue as this minio/minio#4799

Swarm routes traffic only to containers that report healthy status, while Minio in distributed mode needs to talk to other peers before it can respond to healthcheck probe. As the Minio containers are not able to talk to each other, distributed Minio is not getting started on Docker Swarm.

unable to run with snapshot

Folder snapshots contains one file: current.snap.

I try to run container with this data:
docker run -i -t --rm -v /snapshots:/var/lib/tarantool -p 3301:3301 --name tarantool tarantool/tarantool:1.7

Container is not starting.
An error about configuration appears:
Can't open /etc/tarantool/config.yml: No such file or directory

Build error: Failed building

[ 42%] Building C object memcached/CMakeFiles/internalso.dir/internal/proto_txt.c.o
[ 50%] Building C object memcached/CMakeFiles/internalso.dir/internal/network.c.o
/tmp/luarocks_memcached-scm-1-4847/memcached/memcached/internal/network.c: In function 'mnet_setsockopt_keepalive':
/tmp/luarocks_memcached-scm-1-4847/memcached/memcached/internal/network.c:169:34: error: 'TCP_KEEPCNT' undeclared (first use in this function)
  if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT,  &kcnt, sizeof(int) == -1) ||
                                  ^
/tmp/luarocks_memcached-scm-1-4847/memcached/memcached/internal/network.c:169:34: note: each undeclared identifier is reported only once for each function it appears in
/tmp/luarocks_memcached-scm-1-4847/memcached/memcached/internal/network.c:170:34: error: 'TCP_KEEPIDLE' undeclared (first use in this function)
      setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &kcnt, sizeof(int) == -1) ||
                                  ^
/tmp/luarocks_memcached-scm-1-4847/memcached/memcached/internal/network.c:171:34: error: 'TCP_KEEPINTL' undeclared (first use in this function)
      setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTL, &kcnt, sizeof(int) == -1)) {
                                  ^
/tmp/luarocks_memcached-scm-1-4847/memcached/memcached/internal/network.c:167:28: error: unused variable 'kintl' [-Werror=unused-variable]
  int kcnt = 5, kidle = 30, kintl = 60;
                            ^
/tmp/luarocks_memcached-scm-1-4847/memcached/memcached/internal/network.c:167:16: error: unused variable 'kidle' [-Werror=unused-variable]
  int kcnt = 5, kidle = 30, kintl = 60;
                ^
cc1: all warnings being treated as errors
memcached/CMakeFiles/internalso.dir/build.make:186: recipe for target 'memcached/CMakeFiles/internalso.dir/internal/network.c.o' failed
make[2]: *** [memcached/CMakeFiles/internalso.dir/internal/network.c.o] Error 1
CMakeFiles/Makefile2:374: recipe for target 'memcached/CMakeFiles/internalso.dir/all' failed
make[1]: *** [memcached/CMakeFiles/internalso.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.
Using http://rocks.tarantool.org/memcached-scm-1.rockspec... switching to 'build' mode
The command '/bin/sh -c set -x     && apk add --no-cache --virtual .run-deps         mariadb-client-libs         libpq         cyrus-sasl     && apk add --no-cache --virtual .build-deps         git         cmake         make         coreutils         gcc         g++         postgresql-dev         lua-dev         musl-dev         cyrus-sasl-dev     && : "---------- luarocks ----------"     && luarocks install avro-schema     && luarocks install expirationd     && luarocks install queue     && luarocks install connpool     && luarocks install shard     && luarocks install http     && luarocks install pg     && luarocks install mysql     && luarocks install memcached     && luarocks install tarantool-prometheus     && luarocks install lua-term     && : "---------- remove build deps ----------"     && apk del .build-deps' returned a non-zero code: 1

The docker's build comand is:
docker build -t tarantool/tarantool github.com/tarantool/tarantool-docker#:1.7

Running a read only Replica in Docker container

What is the proper way of running readonly replica in a Docker container? There is no parameter (environment variable) that can be used for that. I can set replica_sources but can't set read only mode for replicas thou it's recommended.

Docker container doesn't support 1.7.4+ options

cat init.lua

box.cfg {
  log_nonblock = true, -- some messages may be lost
}
docker run -v $(pwd):/opt/tarantool  -t -i tarantool/tarantool:1.7 tarantool init.lua
/usr/local/bin/tarantool-entrypoint.lua: Creating configuration file: /etc/tarantool/config.yml
/usr/local/bin/tarantool-entrypoint.lua: Config:
---
log_nonblock: true
wal_dir: /var/lib/tarantool
snap_dir: /var/lib/tarantool
listen: 3301
pid_file: /var/run/tarantool/tarantool.pid
snapshot_period: 3600
...

/usr/local/bin/tarantool-entrypoint.lua: Incorrect value for option 'log_nonblock': unexpected option

fatal error: sasl/sasl.h: No such file or directory

docker build -t tarantool/tarantool github.com/tarantool/tarantool-docker#:1.7 started to fail with:

-- Found small: /usr/include  
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_memcached-scm-1-320/memcached/build.luarocks
Scanning dependencies of target generate_proto_txt_parser_c
[  7%] Built target generate_proto_txt_parser_c
Scanning dependencies of target internalso
[ 14%] Building C object memcached/CMakeFiles/internalso.dir/internal/constants.c.o
[ 21%] Building C object memcached/CMakeFiles/internalso.dir/internal/utils.c.o
[ 28%] Building C object memcached/CMakeFiles/internalso.dir/internal/proto_bin.c.o
[ 35%] Building C object memcached/CMakeFiles/internalso.dir/internal/proto_txt_parser.c.o
[ 42%] Building C object memcached/CMakeFiles/internalso.dir/internal/proto_txt.c.o
[ 50%] Building C object memcached/CMakeFiles/internalso.dir/internal/network.c.o
[ 57%] Building C object memcached/CMakeFiles/internalso.dir/internal/memcached_layer.c.o
[ 64%] Building C object memcached/CMakeFiles/internalso.dir/internal/expiration.c.o
[ 71%] Building C object memcached/CMakeFiles/internalso.dir/internal/memcached.c.o
[ 78%] Building C object memcached/CMakeFiles/internalso.dir/internal/msgpuck.c.o
[ 85%] Building C object memcached/CMakeFiles/internalso.dir/internal/mc_sasl.c.o
/tmp/luarocks_memcached-scm-1-320/memcached/memcached/internal/mc_sasl.c:13:23: fatal error: sasl/sasl.h: No such file or directory
compilation terminated.
memcached/CMakeFiles/internalso.dir/build.make:306: recipe for target 'memcached/CMakeFiles/internalso.dir/internal/mc_sasl.c.o' failed
make[2]: *** [memcached/CMakeFiles/internalso.dir/internal/mc_sasl.c.o] Error 1
make[1]: *** [memcached/CMakeFiles/internalso.dir/all] Error 2
CMakeFiles/Makefile2:374: recipe for target 'memcached/CMakeFiles/internalso.dir/all' failed
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.
Using http://rocks.tarantool.org/memcached-scm-1.rockspec... switching to 'build' mode
The command '/bin/sh -c set -x     && apk add --no-cache --virtual .run-deps         mariadb-client-libs         libpq     && apk add --no-cache --virtual .build-deps         git         cmake         make         coreutils         gcc         g++         postgresql-dev         lua-dev         musl-dev     && : "---------- luarocks ----------"     && luarocks install avro-schema     && luarocks install expirationd     && luarocks install queue     && luarocks install connpool     && luarocks install shard     && luarocks install http     && luarocks install pg     && luarocks install mysql     && luarocks install memcached     && luarocks install tarantool-prometheus     && luarocks install lua-term     && : "---------- remove build deps ----------"     && apk del .build-deps' returned a non-zero code: 1

1.8?

I'm a bit confused. I see in some documentation for 1.8 that ansi sql was added. But on the main tarantool page, including the what's new sections, 1.8 isn't even mentioned. Nor is there a docker image for 1.8. Is there some problems with 1.8? The docs should explain this discrepancy.

Add -e REPLICATION_INFINITE_TIMEOUT=true

Problem with several replication sources.

start 2 servers with 3 replication sources...

docker run -p 3301:3301 -e TARANTOOL_REPLICATION_SOURCE=10.0.1.2:3301,10.0.1.2:3302,10.0.1.2:3303
docker run -p 3302:3301-e TARANTOOL_REPLICATION_SOURCE=10.0.1.2:3301,10.0.1.2:3302,10.0.1.2:3303

and then got error and ALL servers failed in one time...
its unacceptable

ER_CFG: Incorrect value for option 'replication_source': failed to connect to one or more servers
2016-11-07 03:11:33.190 [1] main/101/tarantool-entrypoint.lua F> can't initialize storage: Incorrect value for option 'replication_source': failed to connect to one or more servers

snapshot_period: 3600
wal_dir: /var/lib/tarantool
listen: 3301
pid_file: /var/run/tarantool/tarantool.pid
replication_source:

  • test:@10.0.1.2:3301
  • test:@10.0.1.2:3302
  • test:@10.0.1.2:3303
    snap_dir: /var/lib/tarantool

could you fix it as soon as possible.
Kostya said about timeouts...

Thank you!

Ubuntu-based image is broken

[root@js ~]# docker run -d --name tarantool1 tarantool/tarantool
docker: Error response from daemon: mkdir /var/lib/docker/overlay/0d397c1833aa41c415577727e34727f1be7992c6ef8df654aab408de7562955a-init/merged/dev/shm: invalid argument.
See 'docker run --help'.

docker-1.11.2, overlayfs over xfs.

centos-based image is ok:
[root@js ~]# docker run -d --name tarantool2 tarantool/tarantool:centos
0f7f7e40937e30079eb5799747f93aac9f683f37d1c25bffc335b36f9bf1633d
[root@js ~]#

Getting UTC timestamp in tarantool container

I'm new with Lua and I have a small problem. I need UTC timestamp in my tarantool script, but when I tried to get timestamp on docker instance such way:

unix/:/var/run/tarantool/tarantool.sock> os.time(os.date("!*t"))
---
- 1516295913
...

I've got timestamp in my local TZ.

unix/:/var/run/tarantool/tarantool.sock> os.difftime(os.time(), os.time(os.date("!*t")))
---
- 0
...

BTW, when I tried to reproduce it in tarantool instance on my local machine, I got correct result:

tarantool> os.time(os.date("!*t"))
---
- 1516285420
...

tarantool> os.difftime(os.time(), os.time(os.date("!*t")))
---
- 10800
...

How can I resolve this problem?

Console will not open after running a script file

Sometimes you should have access to Tarantool console after your script file has finished. Now it does not fall to console after, for example, CMD ["tarantool", "/opt/tarantool/init.lua"]. Would an option or a specific argument be sufficient in this case?

Remove LuaRocks

LuaRocks has been replaced by tarantoolctl rocks install. Please use tarantoolctl instead of luarocks.
Document how to install third-party modules using tarantoolctl rocks install.

tarantoolctl rocks vs luarocks?

Trying to use the docker image and it seems broken.

When I connect to the console require('mysql') doesn't load the rock.

unix/:/var/run/tarantool/tarantool.sock> local mysql = require('mysql')
---
...

unix/:/var/run/tarantool/tarantool.sock> local pool = mysql.pool_create({ host = '127.0.0.1', user = 'user', password = 'password', db = 'db', size = 5 })
---
- error: '[string "local pool = mysql.pool_create({ host = ''127...."]:1: attempt
    to index global ''mysql'' (a nil value)'
...

When I logon to the container via /bin/sh

tarantoolctl rocks list shows nothing

~ # tarantoolctl rocks list

Installed rocks:
----------------

luarocks list shows all the bundled rocks

~ # luarocks list

Installed rocks:
----------------

avro-schema
   2.0.1-1 (installed) - /usr/local/lib/luarocks/rocks

connpool
   1.1.1-1 (installed) - /usr/local/lib/luarocks/rocks

expirationd
   1.0.1-1 (installed) - /usr/local/lib/luarocks/rocks

gis
   1.0.0-1 (installed) - /usr/local/lib/luarocks/rocks

gperftools
   1.0.1-1 (installed) - /usr/local/lib/luarocks/rocks

http
   1.0.1-1 (installed) - /usr/local/lib/luarocks/rocks

ldoc
   1.4.6-2 (installed) - /usr/local/lib/luarocks/rocks

lua-term
   0.7-1 (installed) - /usr/local/lib/luarocks/rocks

luafilesystem
   1.7.0-2 (installed) - /usr/local/lib/luarocks/rocks

markdown
   0.33-1 (installed) - /usr/local/lib/luarocks/rocks

memcached
   1.0.0-1 (installed) - /usr/local/lib/luarocks/rocks

mqtt
   1.2.1-1 (installed) - /usr/local/lib/luarocks/rocks

mysql
   2.0.1-1 (installed) - /usr/local/lib/luarocks/rocks

penlight
   1.5.4-1 (installed) - /usr/local/lib/luarocks/rocks

pg
   2.0.1-1 (installed) - /usr/local/lib/luarocks/rocks

prometheus
   1.0.0-1 (installed) - /usr/local/lib/luarocks/rocks

queue
   1.0.2-1 (installed) - /usr/local/lib/luarocks/rocks

shard
   scm-1 (installed) - /usr/local/lib/luarocks/rocks

tarantool-curl
   2.3.1-1 (installed) - /usr/local/lib/luarocks/rocks

Trying to move forward with testing. Please advise.

Docker image should have more tags

It will be good to implement same version strategy as progaudi/docker

Version strategy

Every build of Tarantool from stable branches is tagged (e.g. branch is 1.7): 1.7.5-123-g234dsa, which can be broken into parts:

  • 1.7 is major version
  • 5 is minor version
  • 123-g234dsa is build version

If we would build an image from that commit, we'll push tags:

  • major version (1.7)
  • minor version (1.7.5)
  • package version (1.7.5-123-g234dsa)

In this way we achieve a couple of interesting things. 1.7 is the latest 1.7 build, so if you care only about major version, use this tag. If you care about specific minor version, then stick to minor version tag (1.7.5). But my recommendation is to stick to most detailed tag (package version).

Please, check out https://hub.docker.com/r/progaudi/tarantool/tags/

tarantool/tarantool:1.6 fails with unexpected option error

$ docker pull tarantool/tarantool:1.6
1.6: Pulling from tarantool/tarantool
Digest: sha256:e82a7e18dcf1c9f2d00696189d72aa16be9603f6b81db1f40b28dc0f7f145a99
Status: Image is up to date for tarantool/tarantool:1.6
$ docker run --rm -it tarantool/tarantool:1.6
/usr/local/bin/tarantool-entrypoint.lua: Creating configuration file: /etc/tarantool/config.yml
/usr/local/bin/tarantool-entrypoint.lua: Config:
---
pid_file: /var/run/tarantool/tarantool.pid
wal_dir: /var/lib/tarantool
checkpoint_interval: 3600
listen: 3301
memtx_dir: /var/lib/tarantool
...

/usr/local/bin/tarantool-entrypoint.lua: Incorrect value for option 'checkpoint_interval': unexpected option

DNS not resolving

cat /etc/resolv.conf

search default.svc.cluster.local svc.cluster.local cluster.local
nameserver 10.3.0.10
options ndots:5

Rename deprecated parameters

Some parameters were renamed in 1.7. These parameters which are set through env variables in docker should be renamed accordingly. For instance, TARANTOOL_SLAB_ALLOC_ARENA should be renamed to TARANTOOL_MEMTX_MEMORY.

icu-date throws error in tarantool:1.x-centos7

I use icu-date

This code throws error:

icu_date = require('icu-date')
date = icu_date:new()
date_dot_format = icu_date.formats.pattern("dd.MM.yy")
date:format(date_dot_format)
- error: '/.rocks/share/tarantool/icu-date/init.lua:17: tarantool instance.lua <running>:
    undefined symbol: udat_formatCalendar_50'

or

icu_date = require('icu-date')
date = icu_date:new()
date:get_time_zone_id()
- error: '/.rocks/share/tarantool/icu-date/init.lua:17: tarantool instance.lua <running>:
    undefined symbol: ucal_getTimeZoneID_50'

This problem was in Tarantool 1.9 and it's in 1.10.
And there is no problem on MacOS, when I run this code locally

Allow to change settings after starting container

Currently if you pass TARANTOOL_SLAB_ALLOC_ARENA env variable on docker run, you won't be able to change it.

We should provide a way for users to change basic options that can be passed through env variables during container lifetime.

Can't create tcp_server Permission denied

Hi there,

I have built a container based on tarantool/tarantool:1.7
It fails to start http server.

2018-09-29 19:52:11.596 [1] main/101/tarantool-entrypoint.lua F> /usr/local/share/lua/5.1/http/server.lua:1119: Can't create tcp_server: Permission denied

Dockerfile

FROM tarantool/tarantool:1.7

COPY init.lua /opt/tarantool

ENV TARANTOOL_USER_NAME test
ENV TARANTOOL_USER_PASSWORD test

EXPOSE 80

CMD ["tarantool", "/opt/tarantool/init.lua"]

init.lua

box.cfg {
    listen = 3301,
    memtx_memory=209715200
}

local server = require('http.server').new('0.0.0.0', 80)
server:start()

docker build -t testtnt .
docker run -p 80:80 testtnt

Creating configuration file: /etc/tarantool/config.yml
Config:
---
pid_file: /var/run/tarantool/tarantool.pid
wal_dir: /var/lib/tarantool
memtx_memory: 209715200
listen: 3301
vinyl_dir: /var/lib/tarantool
memtx_dir: /var/lib/tarantool
...

2018-09-29 19:52:11.587 [1] main/101/tarantool-entrypoint.lua C> Tarantool 1.7.6-11-gcd17b77f9
2018-09-29 19:52:11.588 [1] main/101/tarantool-entrypoint.lua C> log level 5
2018-09-29 19:52:11.588 [1] main/101/tarantool-entrypoint.lua I> mapping 218103808 bytes for memtx tuple arena...
2018-09-29 19:52:11.588 [1] main/101/tarantool-entrypoint.lua I> mapping 134217728 bytes for vinyl tuple arena...
2018-09-29 19:52:11.588 [1] iproto/101/main I> binary: bound to 0.0.0.0:3301
2018-09-29 19:52:11.589 [1] main/101/tarantool-entrypoint.lua I> initializing an empty data directory
2018-09-29 19:52:11.590 [1] snapshot/101/main I> saving snapshot `/var/lib/tarantool/00000000000000000000.snap.inprogress'
2018-09-29 19:52:11.592 [1] snapshot/101/main I> done
2018-09-29 19:52:11.592 [1] main/101/tarantool-entrypoint.lua I> ready to accept requests
2018-09-29 19:52:11.592 [1] main/104/checkpoint_daemon I> started
2018-09-29 19:52:11.592 [1] main/104/checkpoint_daemon I> scheduled the next snapshot at Sat Sep 29 21:45:22 2018
2018-09-29 19:52:11.593 [1] main/101/tarantool-entrypoint.lua I> Initializing database
2018-09-29 19:52:11.593 [1] main/101/tarantool-entrypoint.lua I> Creating user 'test'
2018-09-29 19:52:11.593 [1] main/101/tarantool-entrypoint.lua I> Granting admin privileges to user 'test'
2018-09-29 19:52:11.594 [1] main/101/tarantool-entrypoint.lua I> Setting password for user 'test'
2018-09-29 19:52:11.594 [1] main/105/console/unix/:/var/run/tarantoo I> started
2018-09-29 19:52:11.596 [1] main/101/tarantool-entrypoint.lua F> /usr/local/share/lua/5.1/http/server.lua:1119: Can't create tcp_server: Permission denied


Have I missed anything?

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.