Problem with Docker

My Docker Container with vaultwarden keeps restaring

Start command

sudo docker run -d  \
    -e RUST_BACKTRACE=full \
    --restart=always \
    -v /bw-data/:/data/ \
    -p 127.0.0.1:8080:80 \
    -p 127.0.0.1:3012:3012 \
    --name bitwarden \
    vaultwarden/server:latest

The Docker log says this


thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }', library/std/src/sys/unix/time.rs:353:62
stack backtrace:
   0:   0xaf8d78 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::had5730c67ab50e4d
   1:   0x5d7090 - core::fmt::write::ha42b2480a34f3eb5
   2:   0xaf1fe4 - std::io::Write::write_fmt::hfa663667fab44c82
   3:   0xafac60 - std::panicking::default_hook::{{closure}}::h6e8d770966f585fd
   4:   0xafa8f0 - std::panicking::default_hook::h71b5cfb8a06cd56f
   5:   0xafb1dc - std::panicking::rust_panic_with_hook::hfc13f45907194734
   6:   0xafb0dc - std::panicking::begin_panic_handler::{{closure}}::h8bd28c15b24c2fb7
   7:   0xaf9390 - std::sys_common::backtrace::__rust_end_short_backtrace::hef7cb296473d0b87
   8:   0xafae6c - rust_begin_unwind
   9:   0x5512f4 - core::panicking::panic_fmt::hc45184285ee465d2
  10:   0x5513c8 - core::result::unwrap_failed::h51f4224fc12cbf0e
  11:   0xb40a88 - tokio::time::driver::Driver<P>::new::hfb66ef6768de0218
  12:   0xb2f658 - tokio::runtime::driver::Driver::new::hb1ee45257e549b73
  13:   0xb2f124 - tokio::runtime::builder::Builder::build::hed4ce3523a05a186
  14:   0xe64f0c - rocket::async_main::h077ba2654118e619
  15:   0xdb5fbc - vaultwarden::main::h433acfc7f8dab814
  16:   0xdd259c - std::sys_common::backtrace::__rust_begin_short_backtrace::heeb0eb3b70d82df1
  17:  0x1168670 - std::rt::lang_start::{{closure}}::ha2f1a90a8484b316
  18:   0xaeb170 - std::rt::lang_start_internal::ha117b08a7dcebcaf
  19:   0xdb5ff0 - main
  20: 0xb6af4a20 - __libc_start_main

See: cannot start docker container v1.25.0 · Discussion #2510 · dani-garcia/vaultwarden · GitHub

Basically the issue is kernel/os version with some mismatching on how some stuff work.
Either:

  • configure the container to use --security-opt seccomp=unconfined to allow those calls to work.
  • Update your Host to the latest version available
  • Use the Alpine container image.