Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Filebeat template bug in image generation #1056

Conversation

davidcr01
Copy link
Contributor

Description

The aim of this PR is to fix a bug in the Docker image generation while using the build-images.sh script. The Filebeat template variable was not being used correctly.

Logs

The image generation was successful with this change:

> sudo bash build-docker-images/build-images.sh                                  
[sudo] password for davidcr01: 
[+] Building 23.1s (20/77)                                                                                                                                                                                     
 => [wazuh/wazuh-dashboard:4.7.0 internal] load build context                                                                                                                                             0.0s
 => => transferring context: 1.93kB                                                                                                                                                                       0.0s
 => [wazuh/wazuh-manager:4.7.0  2/17] RUN rm /bin/sh && ln -s /bin/bash /bin/sh                                                                                                                           1.3s
 => [wazuh/wazuh-indexer:4.7.0 builder 2/9] RUN apt-get update -y && apt-get install curl openssl xz-utils -y                                                                                            11.5s
 => [wazuh/wazuh-indexer:4.7.0 stage-1  2/14] RUN getent group wazuh-indexer || groupadd -r -g 1000 wazuh-indexer                                                                                         1.3s
 => [wazuh/wazuh-dashboard:4.7.0 builder  2/17] RUN apt-get update && apt install curl libcap2-bin xz-utils -y                                                                                           11.5s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1  2/13] RUN apt update && apt install -y libnss3-dev fonts-liberation libfontconfig1                                                                             11.5s
 => => # Get:3 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [3109 kB]                                                                                                                 
 => => # Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]                                                                                                                              
 => => # Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]                                                                                                                            
 => => # Get:6 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]                                                                                                                      
 => => # Get:7 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]                                                                                                                       
 => => # Get:8 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [2896 kB]                                                                                                           
[+] Building 23.2s (20/77)                                                                                                                                                                                     
 => [wazuh/wazuh-dashboard:4.7.0 internal] load build context                                                                                                                                             0.0s
 => => transferring context: 1.93kB                                                                                                                                                                       0.0s
 => [wazuh/wazuh-manager:4.7.0  2/17] RUN rm /bin/sh && ln -s /bin/bash /bin/sh                                                                                                                           1.3s
 => [wazuh/wazuh-indexer:4.7.0 builder 2/9] RUN apt-get update -y && apt-get install curl openssl xz-utils -y                                                                                            11.7s
 => [wazuh/wazuh-indexer:4.7.0 stage-1  2/14] RUN getent group wazuh-indexer || groupadd -r -g 1000 wazuh-indexer                                                                                         1.3s
 => [wazuh/wazuh-dashboard:4.7.0 builder  2/17] RUN apt-get update && apt install curl libcap2-bin xz-utils -y                                                                                           11.6s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1  2/13] RUN apt update && apt install -y libnss3-dev fonts-liberation libfontconfig1                                                                             11.6s
 => => # Get:3 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [3109 kB]                                                                                                                 
 => => # Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]                                                                                                                              
 => => # Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]                                                                                                                            
 => => # Get:6 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]                                                                                                                      
 => => # Get:7 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]                                                                                                                       
 => => # Get:8 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [2896 kB]                                                                                                           
[+] Building 23.7s (20/77)                                                                     
 => [wazuh/wazuh-dashboard:4.7.0 internal] load build context                             0.0sh
 => => transferring context: 1.93kB                                                       0.0s
 => [wazuh/wazuh-manager:4.7.0  2/17] RUN rm /bin/sh && ln -s /bin/bash /bin/sh           1.3sp
 => [wazuh/wazuh-indexer:4.7.0 builder 2/9] RUN apt-get update -y && apt-get install cu  12.1s 
 => [wazuh/wazuh-indexer:4.7.0 stage-1  2/14] RUN getent group wazuh-indexer || groupadd  1.3s
 => [wazuh/wazuh-dashboard:4.7.0 builder  2/17] RUN apt-get update && apt install curl   12.1s 
 => [wazuh/wazuh-dashboard:4.7.0 stage-1  2/13] RUN apt update && apt install -y libnss  12.1s 
 => => # Get:3 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [3109 kB] 
 => => # Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]               
 => => # Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]     [+] Building 478.0s (80/80) FINISHED                                                   
 => [wazuh/wazuh-dashboard:4.7.0 internal] load build definition from Dockerfile  0.0sB
 => => transferring dockerfile: 3.66kB                                            0.0s
 => [wazuh/wazuh-dashboard:4.7.0 internal] load .dockerignore                     0.0s]
 => => transferring context: 2B                                                   0.0s
 => [wazuh/wazuh-indexer:4.7.0 internal] load build definition from Dockerfile    0.0sg
 => => transferring dockerfile: 2.38kB                                            0.0s
 => [wazuh/wazuh-indexer:4.7.0 internal] load .dockerignore                       0.0s0
 => => transferring context: 2B                                                   0.0s
 => [wazuh/wazuh-indexer:4.7.0 internal] load metadata for docker.io/library/ubu  2.1sp
 => [wazuh/wazuh-manager:4.7.0 internal] load .dockerignore                       0.0s
 => => transferring context: 2B                                                   0.0s 
 => [wazuh/wazuh-manager:4.7.0 internal] load build definition from Dockerfile    0.0s
 => => transferring dockerfile: 2.09kB                                            0.0s 
 => CACHED [wazuh/wazuh-manager:4.7.0] https://raw.githubusercontent.com/wazuh/w  0.7s
 => [wazuh/wazuh-indexer:4.7.0 internal] load build context                       0.0s 
 => => transferring context: 6.80kB                                               0.0s 
 => [wazuh/wazuh-manager:4.7.0 internal] load build context                       0.0s 
 => => transferring context: 4.93kB                                               0.0s 
 => [wazuh/wazuh-manager:4.7.0 stage-1  1/14] FROM docker.io/library/ubuntu:foca  9.5s 
 => => resolve docker.io/library/ubuntu:focal@sha256:ed4a42283d9943135ed87d4ee34  0.0s 
 => => sha256:ed4a42283d9943135ed87d4ee34e542f7f5ad9ecf2f244870e 1.13kB / 1.13kB  0.0s
 => => sha256:218bb51abbd1864df8be26166f847547b3851a89999ca7bfceb85c 424B / 424B  0.0s
 => => sha256:bf40b7bc7a11b43785755d3c5f23dee03b08e988b327a2f10b 2.30kB / 2.30kB  0.0s
 => => sha256:96d54c3075c9eeaed5561fd620828fd6bb5d80ecae7cb25f 27.51MB / 27.51MB  8.0s
 => => extracting sha256:96d54c3075c9eeaed5561fd620828fd6bb5d80ecae7cb25f9ba5f7d  1.2s
 => [wazuh/wazuh-dashboard:4.7.0 internal] load build context                     0.0s
 => => transferring context: 1.93kB                                               0.0s
 => [wazuh/wazuh-manager:4.7.0  2/17] RUN rm /bin/sh && ln -s /bin/bash /bin/sh   1.3s
 => [wazuh/wazuh-indexer:4.7.0 builder 2/9] RUN apt-get update -y && apt-get in  48.9s
 => [wazuh/wazuh-indexer:4.7.0 stage-1  2/14] RUN getent group wazuh-indexer ||   1.3s
 => [wazuh/wazuh-dashboard:4.7.0 builder  2/17] RUN apt-get update && apt insta  50.4s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1  2/13] RUN apt update && apt install -  40.0s
 => [wazuh/wazuh-indexer:4.7.0 stage-1  3/14] RUN useradd --system             -  0.7s
 => [wazuh/wazuh-manager:4.7.0  3/17] RUN apt-get update && apt install curl ap  51.5s
 => [wazuh/wazuh-indexer:4.7.0 stage-1  4/14] WORKDIR /usr/share/wazuh-indexer    0.1s
 => [wazuh/wazuh-indexer:4.7.0 stage-1  5/14] COPY config/entrypoint.sh /         0.1s
 => [wazuh/wazuh-indexer:4.7.0 stage-1  6/14] COPY config/securityadmin.sh /      0.1s
 => [wazuh/wazuh-indexer:4.7.0 stage-1  7/14] RUN chmod 700 /entrypoint.sh && ch  0.6s
 => [wazuh/wazuh-indexer:4.7.0 stage-1  8/14] RUN chown 1000:1000 /*.sh           0.5s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1  3/13] RUN getent group wazuh-dashboard  0.5s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1  4/13] RUN useradd --system              0.4s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1  5/13] COPY config/entrypoint.sh /       0.1s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1  6/13] COPY config/wazuh_app_config.sh   0.1s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1  7/13] RUN chmod 700 /entrypoint.sh      0.3s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1  8/13] RUN chmod 700 /wazuh_app_config.  0.5s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1  9/13] RUN chown 1000:1000 /*.sh         0.4s
 => [wazuh/wazuh-indexer:4.7.0 builder 3/9] COPY config/opensearch.yml /          0.1s
 => [wazuh/wazuh-indexer:4.7.0 builder 4/9] COPY config/config.sh .               0.1s
 => [wazuh/wazuh-indexer:4.7.0 builder 5/9] COPY config/config.yml /              0.1s
 => [wazuh/wazuh-indexer:4.7.0 builder 6/9] COPY config/internal_users.yml /      0.1s
 => [wazuh/wazuh-indexer:4.7.0 builder 7/9] COPY config/roles_mapping.yml /       0.1s
 => [wazuh/wazuh-indexer:4.7.0 builder 8/9] COPY config/roles.yml /               0.1s
 => [wazuh/wazuh-indexer:4.7.0 builder 9/9] RUN bash config.sh                  392.1s
 => [wazuh/wazuh-dashboard:4.7.0 builder  3/17] RUN mkdir -p /usr/share/wazuh-da  0.4s
 => [wazuh/wazuh-dashboard:4.7.0 builder  4/17] COPY config/dl_base.sh .          0.1s
 => [wazuh/wazuh-dashboard:4.7.0 builder  5/17] RUN bash dl_base.sh             151.9s
 => [wazuh/wazuh-manager:4.7.0  4/17] COPY config/check_repository.sh /           0.1s
 => [wazuh/wazuh-manager:4.7.0  5/17] RUN chmod 775 /check_repository.sh          0.3s
 => [wazuh/wazuh-manager:4.7.0  6/17] RUN source /check_repository.sh             2.7s
 => [wazuh/wazuh-manager:4.7.0  7/17] RUN apt-get update &&     apt-get instal  208.4s
 => [wazuh/wazuh-dashboard:4.7.0 builder  6/17] COPY config/config.sh .           0.1s
 => [wazuh/wazuh-dashboard:4.7.0 builder  7/17] COPY config/config.yml /          0.0s
 => [wazuh/wazuh-dashboard:4.7.0 builder  8/17] RUN bash config.sh                4.0s
 => [wazuh/wazuh-dashboard:4.7.0 builder  9/17] COPY config/install_wazuh_app.sh  0.0s
 => [wazuh/wazuh-dashboard:4.7.0 builder 10/17] RUN chmod 775 /install_wazuh_app  0.3s
 => [wazuh/wazuh-dashboard:4.7.0 builder 11/17] RUN bash /install_wazuh_app.sh   35.0s
 => [wazuh/wazuh-dashboard:4.7.0 builder 12/17] COPY config/opensearch_dashboard  0.1s
 => [wazuh/wazuh-dashboard:4.7.0 builder 13/17] COPY config/wazuh.yml /usr/share  0.1s
 => [wazuh/wazuh-dashboard:4.7.0 builder 14/17] RUN chown 101:101 /usr/share/waz  0.3s
 => [wazuh/wazuh-dashboard:4.7.0 builder 15/17] RUN mkdir -p /usr/share/wazuh-da  0.4s
 => [wazuh/wazuh-dashboard:4.7.0 builder 16/17] RUN mkdir -p /usr/share/wazuh-da  0.5s
 => [wazuh/wazuh-dashboard:4.7.0 builder 17/17] RUN mkdir -p /usr/share/wazuh-da  0.4s
 => [wazuh/wazuh-manager:4.7.0  8/17] RUN curl -L -O https://artifacts.elastic.  21.0s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1 10/13] COPY --from=builder --chown=100  33.4s
 => [wazuh/wazuh-manager:4.7.0  9/17] RUN curl --fail --silent -L https://github  4.7s
 => [wazuh/wazuh-manager:4.7.0 10/17] COPY config/etc/ /etc/                      0.2s
 => [wazuh/wazuh-manager:4.7.0 11/17] COPY --chown=root:wazuh config/create_user  0.2s
 => [wazuh/wazuh-manager:4.7.0 12/17] COPY config/filebeat.yml /etc/filebeat/     0.1s
 => [wazuh/wazuh-manager:4.7.0 13/17] RUN chmod go-w /etc/filebeat/filebeat.yml   0.3s
 => [wazuh/wazuh-manager:4.7.0 14/17] ADD https://raw.githubusercontent.com/wazu  0.1s
 => [wazuh/wazuh-manager:4.7.0 15/17] RUN chmod go-w /etc/filebeat/wazuh-templat  0.4s
 => [wazuh/wazuh-manager:4.7.0 16/17] COPY config/permanent_data.env config/perm  0.1s
 => [wazuh/wazuh-manager:4.7.0 17/17] RUN chmod 755 /permanent_data.sh &&     sy  0.7s
 => [wazuh/wazuh-manager:4.7.0] exporting to image                               10.5s
 => => exporting layers                                                          10.5s
 => => writing image sha256:250f2c440eb5ad5f5369954958a204c4a4dc568e91a3ec8876f0  0.0s
 => => naming to docker.io/wazuh/wazuh-manager:4.7.0                              0.0s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1 11/13] RUN mkdir -p /usr/share/wazuh-da  0.3s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1 12/13] RUN chown 1000:1000 /usr/share/w  0.4s
 => [wazuh/wazuh-dashboard:4.7.0 stage-1 13/13] WORKDIR /usr/share/wazuh-dashboa  0.1s
 => [wazuh/wazuh-dashboard:4.7.0] exporting to image                             18.4s
 => => exporting layers                                                          18.4s
 => => writing image sha256:892d0a1757a9cc0ccfa0ab7a436b12fea4934412d8c33a5037f4  0.0s
 => => naming to docker.io/wazuh/wazuh-dashboard:4.7.0                            0.0s
 => [wazuh/wazuh-indexer:4.7.0 stage-1  9/14] COPY --from=builder --chown=1000:1  5.7s
 => [wazuh/wazuh-indexer:4.7.0 stage-1 10/14] COPY --from=builder --chown=0:0 /d  0.2s
 => [wazuh/wazuh-indexer:4.7.0 stage-1 11/14] COPY --from=builder --chown=0:0 /d  0.1s
 => [wazuh/wazuh-indexer:4.7.0 stage-1 12/14] COPY --from=builder --chown=0:0 /d  0.1s
 => [wazuh/wazuh-indexer:4.7.0 stage-1 13/14] RUN chown -R 1000:1000 /usr/share/  9.8s
 => [wazuh/wazuh-indexer:4.7.0 stage-1 14/14] RUN mkdir -p /var/lib/wazuh-indexe  0.4s
 => [wazuh/wazuh-indexer:4.7.0] exporting to image                                5.4s
 => => exporting layers                                                           5.4s
 => => writing image sha256:e304b6ba0c9d06cf861ac60991c0afcabe70ef8fdd7b357cdec5  0.0s
 => => naming to docker.io/wazuh/wazuh-indexer:4.7.0 
> sudo docker image ls                                 
REPOSITORY                 TAG       IMAGE ID       CREATED         SIZE
wazuh/wazuh-indexer        4.7.0     e304b6ba0c9d   2 minutes ago   2.02GB
wazuh/wazuh-dashboard      4.7.0     892d0a1757a9   4 minutes ago   1.06GB
wazuh/wazuh-manager        4.7.0     250f2c440eb5   4 minutes ago   868MB

@davidcr01 davidcr01 self-assigned this Oct 16, 2023
@davidcr01 davidcr01 linked an issue Oct 16, 2023 that may be closed by this pull request
4 tasks
@teddytpc1 teddytpc1 merged commit b8ff013 into 4.7.0 Oct 17, 2023
5 checks passed
@teddytpc1 teddytpc1 deleted the bug/1054-the-images-build-fails-due-to-filebeat-template-branch branch October 17, 2023 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The images build fails due to Filebeat template branch
3 participants