Skip to content

Commit

Permalink
Adjusted instructions to use cf-remote and lts version/tag instead of…
Browse files Browse the repository at this point in the history
… 3.24.0-1
  • Loading branch information
craigcomstock committed Dec 10, 2024
1 parent f7758aa commit 7c34ddc
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ docker run --privileged -dit --name=cfengine-server registry.access.redhat.com/u
Prepare the container for **cfengine-server**

```command
docker exec cfengine-server bash -c "dnf -y update; dnf -y install procps-ng iproute"
docker exec cfengine-server bash -c "dnf -y update; dnf -y install procps-ng iproute sudo pip; pip install cf-remote"
```

Install cfengine-community package

```command
docker exec cfengine-server bash -c "dnf -y install https://cfengine-package-repos.s3.amazonaws.com/community_binaries/Community-3.24.0/agent_rhel9_x86_64/cfengine-community-3.24.0-1.el9.x86_64.rpm"
docker exec cfengine-server bash -c "cf-remote install --edition community --clients localhost"
```

Bootstrap cf-agent
Expand All @@ -76,13 +76,13 @@ docker run --privileged -dit --name=cfengine-agent registry.access.redhat.com/ub
Prepare the container for **cfengine-agent**

```command
docker exec cfengine-agent bash -c "dnf -y update; dnf -y install procps-ng iproute"
docker exec cfengine-agent bash -c "dnf -y update; dnf -y install procps-ng iproute sudo pip; pip install cf-remote"
```

Install cfengine-community package

```command
docker exec cfengine-agent bash -c "dnf -y install https://cfengine-package-repos.s3.amazonaws.com/community_binaries/Community-3.24.0/agent_rhel9_x86_64/cfengine-community-3.24.0-1.el9.x86_64.rpm"
docker exec cfengine-agent bash -c "cf-remote install --edition community --clients localhost"
```

### Bootstrap cfengine-agent to the policy server container.
Expand All @@ -104,11 +104,12 @@ Create a `Dockerfile` with following contents:

```Dockerfile
FROM registry.access.redhat.com/ubi9-init:latest
LABEL description="This Dockerfile builds container image based on ubi9-init for cfengine-community-3.24.0.1 rpm."
LABEL description="This Dockerfile builds container image based on ubi9-init and latest LTS release of cfengine-community."

RUN dnf -y update \
&& dnf -y install bind-utils iproute procps-ng \
&& dnf -y install https://cfengine-package-repos.s3.amazonaws.com/community_binaries/Community-3.24.0/agent_rhel9_x86_64/cfengine-community-3.24.0-1.el9.x86_64.rpm
&& dnf -y install bind-utils iproute sudo pip procps-ng \
&& pip install cf-remote \
&& cf-remote install --edition community --clients localhost \

HEALTHCHECK --interval=5s --timeout=15s --retries=3 \
CMD /usr/local/sbin/cf-agent --self-diagnostics || exit 1
Expand All @@ -119,7 +120,7 @@ ENTRYPOINT ["/usr/sbin/init"]
Validate the Dockerfile

```command
docker build -t cfengine:3.24.0-1 -f Dockerfile . --check
docker build -t cfengine:lts -f Dockerfile . --check
```
```output
[+] Building 0.1s (3/3) FINISHED docker:default
Expand All @@ -136,7 +137,7 @@ Check complete, no warnings found.
Build the docker image based on above Dockerfile:

```command
docker build -t cfengine:3.24.0-1 -f Dockerfile .
docker build -t cfengine:lts -f Dockerfile .
```

Verify created image:
Expand All @@ -146,7 +147,7 @@ docker image ls cfengine
```
```output
REPOSITORY TAG IMAGE ID CREATED SIZE
cfengine 3.24.0-1 <IMAGE_ID> About an hour ago 302MB
cfengine lts <IMAGE_ID> About an hour ago 302MB
```

### Using docker compose service
Expand All @@ -159,7 +160,7 @@ name: cfengine-demo
services:
cfengine-server:
container_name: cfengine-server
image: cfengine:3.24.0-1
image: cfengine:lts
build:
context: .
dockerfile: Dockerfile
Expand All @@ -173,7 +174,7 @@ services:
- control-plane

cfengine-agent:
image: cfengine:3.24.0-1
image: cfengine:lts
build:
context: .
dockerfile: Dockerfile
Expand Down

0 comments on commit 7c34ddc

Please sign in to comment.