Using the AWX Docker image at https://quay.io/repository/ansible/awx

Hi

I like the idea of consuming Ansible in a ready-made Docker image. So when I found https://quay.io/repository/ansible/awx, I did a:

docker pull quay.io/ansible/awx

on my SLES system. But when I tried to run the image, I saw:

ldpdd040:~ # docker run quay.io/ansible/awx
Usage: dumb-init [option] program [args]
Try dumb-init --help for full usage.
ldpdd040:~ #

https://github.com/ansible/awx/issues/12426 mentions, “The image you mentioned is the official image, but it’s not designed to run directly and separately using docker run. Typically it shoud be used with Kubernetes, OpenShift, or Docker Compose.” This comment also mentions, “Refer the official installation guide: https://github.com/ansible/awx/blob/devel/INSTALL.md”. I did, but didn’t find any information on how to use this pre-made AWX Docker image.

Help, please. Thanks!

Hi!

You don’t run awx through docker. You run out through kubernetes. You can use a bunch of Distributions. A light weight one I like to use is k3s.

Here is the github repo and documentation to install it.

https://github.com/ansible/awx-operator

Hi Wei-Yen

Thanks very much for your fast answer.

I’ve been working on setting up AWX Operator (https://github.com/ansible/awx-operator), so have already installed minikube. So, these steps seemed to work:

docker pull quay.io/ansible/awx

minikube start --cpus=4 --memory=6g –force

minikube image load quay.io/ansible/awx

After this, I was able to see AWX in the minikube environment

ldpdd040:~ # minikube ssh

Last login: Tue Jul 18 15:59:14 2023 from 192.168.49.1

docker@minikube:~$ docker images

REPOSITORY TAG IMAGE ID CREATED SIZE

quay.io/ansible/awx latest fde176845f8c 7 days ago 848MB

registry.k8s.io/kube-apiserver v1.26.3 1d9b3cbae03c 4 months ago 134MB

registry.k8s.io/kube-scheduler v1.26.3 5a7904736932 4 months ago 56.4MB

registry.k8s.io/kube-controller-manager v1.26.3 ce8c2293ef09 4 months ago 123MB

registry.k8s.io/kube-proxy v1.26.3 92ed2bec97a6 4 months ago 65.6MB

registry.k8s.io/etcd 3.5.6-0 fce326961ae2 7 months ago 299MB

registry.k8s.io/pause 3.9 e6f181688397 9 months ago 744kB

registry.k8s.io/coredns/coredns v1.9.3 5185b96f0bec 13 months ago 48.8MB

gcr.io/k8s-minikube/storage-provisioner v5 6e38f40d628d 2 years ago 31.5MB

docker@minikube:~$

I’m looking for a command to run the image.

Thanks again!

tl

Internal Use - Confidential

Hi

I did some more testing, but can’t get the AWX Docker image found in https://quay.io/repository/ansible/awx to work in minikube. Here are the commands I used:

minikube delete
minikube start --cpus=4 --memory=6g --force

docker pull quay.io/ansible/awx

minikube image load quay.io/ansible/awx:latest
minikube image ls - confirmed that the AWX image is there
kubectl run awx --image=quay.io/ansible/awx:latest

When I run ‘kubectls get pods’ to verify the health of the run, I see:

kubectl get pods

NAME READY STATUS RESTARTS AGE
awx 0/1 ImagePullBackOff 0 7m39s

Running things in kubernetes is not the same as docker. You don’t just run the image. I would suggest going to that link I sent before.

https://github.com/ansible/awx-operator

Follow those instructions

Thanks. I had tried to use AWX Operator, but had a problem with that and opened a bug: https://github.com/kubernetes/minikube/issues/16896. I thought use of this pre-built AWX Docker image might be easier. I guess not.

Thanks for the help.

Use K3S - it’s working out of the box.
https://docs.k3s.io/

Working out of the box would be cool, but not (by me) achievable. I followed https://docs.k3s.io/quick-start and https://github.com/ansible/awx-operator#basic-install.

curl -sfL https://get.k3s.io | sh -

kubectl apply -k .

kubectl get pods -n awx
NAME READY STATUS RESTARTS AGE
awx-operator-controller-manager-6c58d59d97-bfw5q 0/2 CreateContainerError 0 20m

A 'tail of /var/lib/rancher/k3s/agent/containerd/containerd.log shows:

time=“2023-07-19T16:57:08.814903184-04:00” level=error msg=“CreateContainer within sandbox "9f0632d06e9075b1a6b2f101f0eb98bb709b057e1233e2ef2702880febc52c8b" for &ContainerMetadata{Name:metrics-server,Attempt:0,} failed” error=“failed to create containerd container: load apparmor profile /tmp/cri-containerd.apparmor.d1451331486: parser error("AppArmor parser error for /tmp/cri-containerd.apparmor.d1451331486 in /tmp/cri-containerd.apparmor.d1451331486 at line 16: syntax error, unexpected TOK_OPENPAREN, expecting TOK_MODE"): exit status 1”

which is silly, because AppArmor is not enabled on this system.

FYI
tl

I stopped using a SLES 12 SP5 system as my AWX server, and instead used a SLES 15 SP4 system. I then again followed the instructions at https://github.com/ansible/awx-operator#basic-install, and everything worked correctly. So, either SLES 12 SP5 does not provide the needed infrastructure, or there is something toxic on that system.

Thank you for your help!