blue-alarm-98979
04/05/2024, 8:53 AMchilly-king-10285
04/05/2024, 8:53 AMchilly-king-10285
04/05/2024, 8:53 AMbash docker pull oryd/kratos:<version-you-want>
2. Run the Docker image: bash docker run --rm -it oryd/kratos:<version-you-want> help
This will start the Ory Kratos Docker container. If you want to run Ory Kratos in debug mode, you can use the Dockerfile-debug
file instead of the regular Dockerfile
. Make sure your build context is in the root directory of Kratos and not the .docker
directory. You'll also need to expose the Delve service port 40000 under the port 8000, as well as the actual port of the service you want to access from your host. Configure the bind mounts and set the run options to --security-opt="apparmor=unconfined" --cap-add=SYS_PTRACE
. You can also clone the Ory Kratos repository and run it using `docker-compose`: bash git clone <https://github.com/ory/kratos.git> cd kratos git checkout <version-you-want> docker-compose -f quickstart.yml -f quickstart-standalone.yml up --build --force-recreate
If you have SELinux, run: bash docker-compose -f quickstart.yml -f quickstart-selinux.yml -f quickstart-standalone.yml up --build --force-recreate
Make sure that ports 4455
, 4433
, 4434
, and 4436
are free and always use 127.0.0.1
as the hostname; never use localhost
. For more detailed instructions, please refer to the [official Ory Kratos documentation](https://www.ory.sh/docs/kratos/install#docker).blue-alarm-98979
04/05/2024, 8:55 AMchilly-king-10285
04/05/2024, 8:55 AMchilly-king-10285
04/05/2024, 8:55 AM--config
flag to specify the path to the configuration file. Here's an example: bash docker run {image-name} serve --config /home/ory/kratos.yml
In this command, replace {image-name}
with the name of your Docker image, and /home/ory/kratos.yml
with the path to your configuration file. If you want to use a local configuration file, you can bind mount the local directory containing the configuration file to the Docker container. Here's an example: bash docker run -it -e DSN="memory" \ --mount type=bind,source="$(pwd)"/contrib/quickstart/kratos/email-password,target=/home/ory \ oryd/kratos:{version} serve --config /home/ory/kratos.yml
In this command, replace {version}
with the version of Ory Kratos you're using, and "$(pwd)"/contrib/quickstart/kratos/email-password
with the path to your local directory containing the configuration file. Please note that this approach is recommended for local development only. For more information, please refer to the [official Ory Kratos documentation](https://www.ory.sh/docs/kratos/guides/docker#binding-configuration-directory).blue-alarm-98979
04/05/2024, 9:04 AMchilly-king-10285
04/05/2024, 9:04 AMchilly-king-10285
04/05/2024, 9:04 AMDockerfile # Use the official Ory Kratos Docker image as the base image FROM oryd/kratos:{{version}} # Copy your configuration file into the container COPY path-to-your-config-file/kratos.yml /home/ory/kratos.yml # Copy your schema file into the container COPY path-to-your-schema-file/identity.schema.json /home/ory/identity.schema.json
In this Dockerfile, replace {{version}}
with the version of Ory Kratos you're using, path-to-your-config-file
with the path to your local directory containing the configuration file, and path-to-your-schema-file
with the path to your local directory containing the schema file. After creating this Dockerfile, you can build a Docker image using the docker build
command, and then run a container from the image using the docker run
command. Here's an example: bash docker build -t my-kratos-image . docker run -it my-kratos-image serve --config /home/ory/kratos.yml
In these commands, replace my-kratos-image
with the name you want to give to your Docker image. For more information, please refer to the [official Ory Kratos documentation](https://www.ory.sh/docs/kratos/guides/docker#creating-custom-docker-images).