cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setup/run oneagent in docker container

lasanga
Visitor

Im trying to setup and run dynatrace/oneagent in a docker container. Image is pulled and container is created successfully after following the steps in the documentation (https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-container-platforms/docker/s...). But it fails when I run it. I get the following errors which are contradicting because I pass those arguments. Can someone help please? Am I missing something?
Note: Im using a docker desktop

 

 

 

Error: Container was launched without --net parameter
Error: Dynatrace OneAgent requires parameters: --pid and --net set to 'host'.
Error: Initialization procedure failed
Error: Container was launched without --net parameter
Error: Dynatrace OneAgent requires parameters: --pid and --net set to 'host'.
Error: Initialization procedure failed
Error: Container was launched without --net parameter
Error: Dynatrace OneAgent requires parameters: --pid and --net set to 'host'.
Error: Initialization procedure failed

 

 

 

docker run -d --restart=on-failure:5 --pid=host --net=host --cap-drop ALL --cap-add CHOWN --cap-add DAC_OVERRIDE --cap-add DAC_READ_SEARCH --cap-add FOWNER --cap-add FSETID --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SETFCAP --cap-add SETGID --cap-add SETUID --cap-add SYS_ADMIN --cap-add SYS_CHROOT --cap-add SYS_PTRACE --cap-add SYS_RESOURCE --security-opt apparmor:unconfined -v /:/mnt/root -e ONEAGENT_INSTALLER_SCRIPT_URL="https://DOMAIN/api/v1/deployment/installer/agent/unix/default/latest?arch=x86" -e ONEAGENT_INSTALLER_DOWNLOAD_TOKEN=TOKEN dynatrace/oneagent APP_LOG_CONTENT_ACCESS=1

 

3 REPLIES 3

andre_vdveen
DynaMight Champion
DynaMight Champion

Hi @lasanga, maybe I'm misreading or misunderstanding, but I don't see which version of Docker you're using and if it is running on a Linux-based host - can you confirm the O/S and version is supported?

Hey @andre_vdveen, yes Im using a Linux based host. Following are the details 
Server: Docker Desktop 4.21.1 (114176)
Engine:
Version: 24.0.2
API version: 1.43 (minimum version 1.12)
Go version: go1.20.4
OS/Arch: linux/amd64
Experimental: false

I had the same scenario. I have docker desktop installed on win11 pc and docker is using wsl2 on win11 for the ubuntu 22.04 linux host. I get the same error when executing cmd to pull and run one agent as a container but the container fails to start and returns this error:

 

2024-03-21 11:17:35 18:17:35 ONEAGENT_READ_ONLY_MODE=
2024-03-21 11:17:35 18:17:35 AGENT_CONTAINER_IMAGE_VERSION=1.281.144.20240119-131910
2024-03-21 11:17:35 18:17:35 Path: /usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2024-03-21 11:17:35 18:17:35 Started with capabilities: self: cap_chown,cap_dac_override,cap_dac_read_search,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_net_admin,cap_net_raw,cap_sys_chroot,cap_sys_ptrace,cap_sys_admin,cap_sys_resource,cap_setfcap=ep
2024-03-21 11:17:35 18:17:35 Started with user: uid=0(root) gid=0(root) groups=0(root)
2024-03-21 11:17:35 18:17:35 If you are not sure how to launch the container please visit: https://www.dynatrace.com/support/help/shortlink/oneagent-docker
2024-03-21 11:12:26 18:12:26 Error: Container was launched without --pid parameter
2024-03-21 11:12:26 18:12:26 Error: Container was launched without --net parameter
2024-03-21 11:12:26 18:12:26 Error: Dynatrace OneAgent requires parameters: --pid and --net set to 'host'.
2024-03-21 11:12:26 18:12:26 Error: Initialization procedure failed

 

As a troubleshooting step, I tried the same cmd against a dedicated physical Ubuntu 22.04 server (not wsl2) and executed same docker run cmd and this time the oneagent container starts with no error. Does this mean running oneagent as docker container is not supported under docker desktop running on win11 + wsl2? 

 

Featured Posts