GolDDranks

Untitled

Feb 16th, 2020
18
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh -eu
  2.  
  3. > test.c cat << EOF
  4. #include <stdio.h>
  5. #include <libpq-fe.h>
  6.  
  7. int main() {
  8. printf("Hello, World\n");
  9. PQconnectStart("testtt");
  10. }
  11. EOF
  12.  
  13. > build_test.sh cat << EOF
  14. #!/bin/sh
  15. musl-gcc -c -I/musl/include test.c
  16. musl-gcc -static -o test test.o -L /musl/lib/ -lpq
  17. ./test
  18. EOF
  19.  
  20. chmod 0755 build_test.sh
  21.  
  22. echo "Building a binary with Postgres 11.7"
  23.  
  24. docker run -it --rm \
  25. -w "/workdir" \
  26. -v "$PWD:/workdir" \
  27. registry.gitlab.com/rust_musl_docker/image/base:openssl-1.1.1d_postgres-11.7 \
  28. ./build_test.sh
  29.  
  30. echo "Building a binary with Postgres 12.0"
  31.  
  32. docker run -it --rm \
  33. -w "/workdir" \
  34. -v "$PWD:/workdir" \
  35. registry.gitlab.com/rust_musl_docker/image/base:openssl-1.1.1d_postgres-12.0 \
  36. ./build_test.sh
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×