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

ADD IMAGE_NAME arg to Dockerfile #4422

Merged
merged 2 commits into from
Sep 11, 2023
Merged

Conversation

fisuda
Copy link
Contributor

@fisuda fisuda commented Sep 10, 2023

This PR adds the IMAGE_NAME argument to Dockerfile. For example, Orion with Ubuntu 22.04 as a base image can be build as shown:

docker build -t orion-ubuntu22.04 --build-arg IMAGE_NAME=ubuntu --build-arg IMAGE_TAG=22.04 --build-arg CLEAN_DEV_TOOLS=0

The build logs:

Result:

  • Orion on Ubuntu 22.04 (x86_64)
$ curl http://localhost:1026/version
{
"orion" : {
  "version" : "3.10.0-next",
  "uptime" : "0 d, 0 h, 0 m, 13 s",
  "git_hash" : "7b6275bb053701af043ed05536ce8facc46f0efc",
  "compile_time" : "Sun Sep 10 02:01:01 UTC 2023",
  "compiled_by" : "root",
  "compiled_in" : "buildkitsandbox",
  "release_date" : "Sun Sep 10 02:01:01 UTC 2023",
  "machine" : "x86_64",
  "doc" : "https://fiware-orion.rtfd.io/",
  "libversions": {
     "boost": "1_74",
     "libcurl": "libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.13 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.16",
     "libmosquitto": "2.0.15",
     "libmicrohttpd": "0.9.76",
     "openssl": "3.0.2",
     "rapidjson": "1.1.0",
     "mongoc": "1.24.3",
     "bson": "1.24.3"
  }
}
}
  • Orion on Ubuntu 22.04 (aarch64)
{
"orion" : {
  "version" : "3.10.0-next",
  "uptime" : "0 d, 0 h, 0 m, 10 s",
  "git_hash" : "7b6275bb053701af043ed05536ce8facc46f0efc",
  "compile_time" : "Sun Sep 10 02:17:40 UTC 2023",
  "compiled_by" : "root",
  "compiled_in" : "buildkitsandbox",
  "release_date" : "Sun Sep 10 02:17:40 UTC 2023",
  "machine" : "aarch64",
  "doc" : "https://fiware-orion.rtfd.io/",
  "libversions": {
     "boost": "1_74",
     "libcurl": "libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.13 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.16",
     "libmosquitto": "2.0.15",
     "libmicrohttpd": "0.9.76",
     "openssl": "3.0.2",
     "rapidjson": "1.1.0",
     "mongoc": "1.24.3",
     "bson": "1.24.3"
  }
}
}

It would be great if you could review this PR.

Thanks.

@@ -19,8 +19,9 @@
# iot_support at tid dot es
#

ARG IMAGE_NAME=debian
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add ARG IMAGE_NAME also to docker/Dockerfile.alpine file.

@fisuda
Copy link
Contributor Author

fisuda commented Sep 11, 2023

I added IMAGE_NAME arg to the Dockerfile.alpine file.
I tested it. But I encountered the same error as when building on Ubuntu 20.04. It seems this error is unrelated to this update.

9025 #6 242.1 [ 17%] Building CXX object src/lib/ngsi/CMakeFiles/ngsi.dir/ContextElementResponse.cpp.o
9026 #6 242.4 /opt/fiware-orion/src/lib/serviceRoutines/versionTreat.cpp: In function 'std::string libVersions()':
9027 #6 242.4 /opt/fiware-orion/src/lib/serviceRoutines/versionTreat.cpp:95:29: error: 'OPENSSL_FULL_VERSION_STR' was not declared in this s     cope
9028 #6 242.4    95 |   total += ssl     + "\"" + OPENSSL_FULL_VERSION_STR  "\"" + ",\n";
9029 #6 242.4       |                             ^~~~~~~~~~~~~~~~~~~~~~~~
9030 #6 242.4 [ 17%] Building CXX object src/lib/common/CMakeFiles/common.dir/logTracing.cpp.o
9031 #6 242.5 make[3]: *** [src/lib/serviceRoutines/CMakeFiles/serviceRoutines.dir/build.make:76: src/lib/serviceRoutines/CMakeFiles/service     Routines.dir/versionTreat.cpp.o] Error 1

The full log is here: 20230911_Dockerfile.alpine

How to reproduce it:

docker build -t orion.alpine -f Dockerfile.alpine --progress plain . |& tee /tmp/orion-alpine-build.log

@fgalan
Copy link
Member

fgalan commented Sep 11, 2023

I added IMAGE_NAME arg to the Dockerfile.alpine file. I tested it. But I encountered the same error as when building on Ubuntu 20.04. It seems this error is unrelated to this update.

9025 #6 242.1 [ 17%] Building CXX object src/lib/ngsi/CMakeFiles/ngsi.dir/ContextElementResponse.cpp.o
9026 #6 242.4 /opt/fiware-orion/src/lib/serviceRoutines/versionTreat.cpp: In function 'std::string libVersions()':
9027 #6 242.4 /opt/fiware-orion/src/lib/serviceRoutines/versionTreat.cpp:95:29: error: 'OPENSSL_FULL_VERSION_STR' was not declared in this s     cope
9028 #6 242.4    95 |   total += ssl     + "\"" + OPENSSL_FULL_VERSION_STR  "\"" + ",\n";
9029 #6 242.4       |                             ^~~~~~~~~~~~~~~~~~~~~~~~
9030 #6 242.4 [ 17%] Building CXX object src/lib/common/CMakeFiles/common.dir/logTracing.cpp.o
9031 #6 242.5 make[3]: *** [src/lib/serviceRoutines/CMakeFiles/serviceRoutines.dir/build.make:76: src/lib/serviceRoutines/CMakeFiles/service     Routines.dir/versionTreat.cpp.o] Error 1

The full log is here: 20230911_Dockerfile.alpine

How to reproduce it:

docker build -t orion.alpine -f Dockerfile.alpine --progress plain . |& tee /tmp/orion-alpine-build.log

I think is related to what I said in this comment.

We could fix CMakeLists.txt in the way suggested in that comment, but it seems osDistro.sh doesn't identifies alpine distro and prints: https://github.com/fisuda/report/blob/master/orion/20230911_Dockerfile.alpine/orion-alpine-build.log#L8879C1-L8879C45

#6 235.6 contextBroker distro: 'Unknown_1.0'

If merging this PR doesn't urge, I can try to investigate how to improve osDistro.sh in this case and provide you some feedback on it.

@fgalan
Copy link
Member

fgalan commented Sep 11, 2023

If merging this PR doesn't urge, I can try to investigate how to improve osDistro.sh in this case and provide you some feedback on it.

Seems interesting https://linuxhint.com/check-version-alpine-linux/ :)

@fgalan
Copy link
Member

fgalan commented Sep 11, 2023

If merging this PR doesn't urge, I can try to investigate how to improve osDistro.sh in this case and provide you some feedback on it.

I understand you did it at the end in PR #4425. Great work! :)

@fisuda
Copy link
Contributor Author

fisuda commented Sep 11, 2023

As you may have noticed, I fixed by PR #4425.

Copy link
Member

@fgalan fgalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fgalan fgalan merged commit dabd64b into telefonicaid:master Sep 11, 2023
12 checks passed
@fisuda fisuda deleted the update/dockerfile branch September 11, 2023 13:06
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.

2 participants