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

Swift Tools #27

Open
rchatham opened this issue Jul 29, 2019 · 4 comments
Open

Swift Tools #27

rchatham opened this issue Jul 29, 2019 · 4 comments

Comments

@rchatham
Copy link

Hi,

I have been trouble getting the docker build command to work. I am repeatedly receiving the error /root/vapor: error: package at '/root/vapor' requires a minimum Swift tools version of 5.0.0 (currently 4.2.0). I upgraded to the latest Xcode 11 Beta and selected the latest tools using sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer. Running swiftenv I can see that the selected swift tools are 5.0 at the repository.

Any help would be greatly appreciated!

I ran the following command replacing the JWT_PUBLIC and JWT_SECRET values with generated rsa public and private keys,

docker build . -t users
docker run -e JWT_PUBLIC='n-value-from-jwt' \
-e DATABASE_HOSTNAME='localhost' \
-e DATABASE_USER='users_service' \
-e DATABASE_PASSWORD='users_service' \
-e DATABASE_DB='users_service' \
-e JWT_SECRET='d-value-from-jwt' -p 8080:8080 users

Here are the logs from running the getting started command.

Sending build context to Docker daemon  120.8MB
Step 1/25 : FROM swift:4.2
 ---> ce1fe933c297
Step 2/25 : ARG ENVIRONMENT
 ---> Using cache
 ---> 52c9704beb14
Step 3/25 : ENV ENVIRONMENT ${ENVIRONMENT:-production}
 ---> Using cache
 ---> 525c39d43606
Step 4/25 : ENV DEBIAN_FRONTEND noninteractive
 ---> Using cache
 ---> 6a1dcf17f6cf
Step 5/25 : ENV TZ=Europe/Berlin
 ---> Using cache
 ---> be3ab5a1e6fc
Step 6/25 : ENV TERM xterm
 ---> Using cache
 ---> 509a1f6fd08d
Step 7/25 : RUN apt-get update && apt-get -y install wget lsb-release apt-transport-https
 ---> Using cache
 ---> 1119f8522a86
Step 8/25 : RUN wget -q https://repo.vapor.codes/apt/keyring.gpg -O- | apt-key add -
 ---> Using cache
 ---> 7025dc9a6736
Step 9/25 : RUN echo "deb https://repo.vapor.codes/apt $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/vapor.list
 ---> Using cache
 ---> 4f2e17d46633
Step 10/25 : RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
 ---> Using cache
 ---> f2a799ef60eb
Step 11/25 : USER root
 ---> Using cache
 ---> 150ff5afb19f
Step 12/25 : RUN apt-get update && apt-get install
 ---> Using cache
 ---> e6fea8edc4c2
Step 13/25 : RUN mkdir /root/vapor
 ---> Using cache
 ---> c0b471d1d3d0
Step 14/25 : ADD . /root/vapor
 ---> Using cache
 ---> 48103aec8142
Step 15/25 : WORKDIR /root/vapor
 ---> Using cache
 ---> a0af880d3b4f
Step 16/25 : RUN cd /root/vapor && rm -rf .build
 ---> Using cache
 ---> 8c070f77c9a0
Step 17/25 : RUN swift package update
 ---> Running in d7df9175b541
/root/vapor: error: package at '/root/vapor' requires a minimum Swift tools version of 5.0.0 (currently 4.2.0)
The command '/bin/sh -c swift package update' returned a non-zero code: 1
Unable to find image 'users:latest' locally
docker: Error response from daemon: pull access denied for users, repository does not exist or may require 'docker login'.

Thanks!

@calebkleveter
Copy link
Contributor

Sorry, the Swift version in the Dockerfile was outdated. Mind pulling the latest changes for this repo and try building it again? Thanks!

@rchatham
Copy link
Author

Thanks, @calebkleveter! It's better. I re-ran it the same way and got these output logs this time. Something to do with openssl?

Sending build context to Docker daemon  120.9MB
Step 1/25 : FROM swift:5.0
5.0: Pulling from library/swift
7413c47ba209: Pull complete 
0fe7e7cbb2e8: Pull complete 
1d425c982345: Pull complete 
344da5c95cec: Pull complete 
9388afda3bca: Pull complete 
47c2eac72406: Pull complete 
Digest: sha256:44cfe80cd32c2ea3320eb80af04026ce77f02693f018acb13342cb1173adcbf5
Status: Downloaded newer image for swift:5.0
 ---> 92429ea076f5
Step 2/25 : ARG ENVIRONMENT
 ---> Running in 22f2e0a7a28c
Removing intermediate container 22f2e0a7a28c
 ---> c319b6796a9f
Step 3/25 : ENV ENVIRONMENT ${ENVIRONMENT:-production}
 ---> Running in 9288a504de46
Removing intermediate container 9288a504de46
 ---> d9d9d7856eed
Step 4/25 : ENV DEBIAN_FRONTEND noninteractive
 ---> Running in 90827e5d8546
Removing intermediate container 90827e5d8546
 ---> 2814dd90d00a
Step 5/25 : ENV TZ=Europe/Berlin
 ---> Running in ff892f9dd917
Removing intermediate container ff892f9dd917
 ---> de3ed20d6522
Step 6/25 : ENV TERM xterm
 ---> Running in 0ebee740e453
Removing intermediate container 0ebee740e453
 ---> d4793a74cc78
Step 7/25 : RUN apt-get update && apt-get -y install wget lsb-release apt-transport-https
 ---> Running in 051e801c53ca
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [727 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1249 kB]
Get:7 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [591 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [902 kB]
Fetched 3721 kB in 3s (1300 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  distro-info-data libmpdec2 libpython3-stdlib libpython3.6-minimal
  libpython3.6-stdlib python3 python3-minimal python3.6 python3.6-minimal
Suggested packages:
  lsb python3-doc python3-tk python3-venv python3.6-venv python3.6-doc
  binfmt-support
The following NEW packages will be installed:
  apt-transport-https distro-info-data libmpdec2 libpython3-stdlib
  libpython3.6-minimal libpython3.6-stdlib lsb-release python3 python3-minimal
  python3.6 python3.6-minimal wget
0 upgraded, 12 newly installed, 0 to remove and 1 not upgraded.
Need to get 4564 kB of archives.
After this operation, 23.3 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-minimal amd64 3.6.8-1~18.04.1 [533 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3.6-minimal amd64 3.6.8-1~18.04.1 [1620 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3-minimal amd64 3.6.7-1~18.04 [23.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 libmpdec2 amd64 2.4.2-1ubuntu1 [84.1 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-stdlib amd64 3.6.8-1~18.04.1 [1715 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3.6 amd64 3.6.8-1~18.04.1 [202 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3-stdlib amd64 3.6.7-1~18.04 [7240 B]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3 amd64 3.6.7-1~18.04 [47.2 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 distro-info-data all 0.37ubuntu0.5 [4568 B]
Get:10 http://archive.ubuntu.com/ubuntu bionic/main amd64 lsb-release all 9.20170808ubuntu1 [11.0 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 wget amd64 1.19.4-1ubuntu2.2 [316 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 apt-transport-https all 1.6.11 [1692 B]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 4564 kB in 2s (3004 kB/s)
Selecting previously unselected package libpython3.6-minimal:amd64.
(Reading database ... 17766 files and directories currently installed.)
Preparing to unpack .../libpython3.6-minimal_3.6.8-1~18.04.1_amd64.deb ...
Unpacking libpython3.6-minimal:amd64 (3.6.8-1~18.04.1) ...
Selecting previously unselected package python3.6-minimal.
Preparing to unpack .../python3.6-minimal_3.6.8-1~18.04.1_amd64.deb ...
Unpacking python3.6-minimal (3.6.8-1~18.04.1) ...
Setting up libpython3.6-minimal:amd64 (3.6.8-1~18.04.1) ...
Setting up python3.6-minimal (3.6.8-1~18.04.1) ...
Selecting previously unselected package python3-minimal.
(Reading database ... 18005 files and directories currently installed.)
Preparing to unpack .../python3-minimal_3.6.7-1~18.04_amd64.deb ...
Unpacking python3-minimal (3.6.7-1~18.04) ...
Selecting previously unselected package libmpdec2:amd64.
Preparing to unpack .../libmpdec2_2.4.2-1ubuntu1_amd64.deb ...
Unpacking libmpdec2:amd64 (2.4.2-1ubuntu1) ...
Selecting previously unselected package libpython3.6-stdlib:amd64.
Preparing to unpack .../libpython3.6-stdlib_3.6.8-1~18.04.1_amd64.deb ...
Unpacking libpython3.6-stdlib:amd64 (3.6.8-1~18.04.1) ...
Selecting previously unselected package python3.6.
Preparing to unpack .../python3.6_3.6.8-1~18.04.1_amd64.deb ...
Unpacking python3.6 (3.6.8-1~18.04.1) ...
Selecting previously unselected package libpython3-stdlib:amd64.
Preparing to unpack .../libpython3-stdlib_3.6.7-1~18.04_amd64.deb ...
Unpacking libpython3-stdlib:amd64 (3.6.7-1~18.04) ...
Setting up python3-minimal (3.6.7-1~18.04) ...
Selecting previously unselected package python3.
(Reading database ... 18409 files and directories currently installed.)
Preparing to unpack .../python3_3.6.7-1~18.04_amd64.deb ...
Unpacking python3 (3.6.7-1~18.04) ...
Selecting previously unselected package distro-info-data.
Preparing to unpack .../distro-info-data_0.37ubuntu0.5_all.deb ...
Unpacking distro-info-data (0.37ubuntu0.5) ...
Selecting previously unselected package lsb-release.
Preparing to unpack .../lsb-release_9.20170808ubuntu1_all.deb ...
Unpacking lsb-release (9.20170808ubuntu1) ...
Selecting previously unselected package wget.
Preparing to unpack .../wget_1.19.4-1ubuntu2.2_amd64.deb ...
Unpacking wget (1.19.4-1ubuntu2.2) ...
Selecting previously unselected package apt-transport-https.
Preparing to unpack .../apt-transport-https_1.6.11_all.deb ...
Unpacking apt-transport-https (1.6.11) ...
Setting up apt-transport-https (1.6.11) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Setting up distro-info-data (0.37ubuntu0.5) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up wget (1.19.4-1ubuntu2.2) ...
Setting up libmpdec2:amd64 (2.4.2-1ubuntu1) ...
Setting up libpython3.6-stdlib:amd64 (3.6.8-1~18.04.1) ...
Setting up python3.6 (3.6.8-1~18.04.1) ...
Setting up libpython3-stdlib:amd64 (3.6.7-1~18.04) ...
Setting up python3 (3.6.7-1~18.04) ...
Setting up lsb-release (9.20170808ubuntu1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Removing intermediate container 051e801c53ca
 ---> c8d2f1ea3675
Step 8/25 : RUN wget -q https://repo.vapor.codes/apt/keyring.gpg -O- | apt-key add -
 ---> Running in 72573070180c
Warning: apt-key output should not be parsed (stdout is not a terminal)
OK
Removing intermediate container 72573070180c
 ---> f0af97711dff
Step 9/25 : RUN echo "deb https://repo.vapor.codes/apt $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/vapor.list
 ---> Running in 1fca3f49402a
deb https://repo.vapor.codes/apt bionic main
Removing intermediate container 1fca3f49402a
 ---> 23e0e15546df
Step 10/25 : RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
 ---> Running in d84346dc6a8b
Removing intermediate container d84346dc6a8b
 ---> 4a5b9368b0bc
Step 11/25 : USER root
 ---> Running in a1925d558dd6
Removing intermediate container a1925d558dd6
 ---> c9bea3415418
Step 12/25 : RUN apt-get update && apt-get install
 ---> Running in f713e7a61d58
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Ign:5 https://repo.vapor.codes/apt bionic InRelease
Get:6 https://repo.vapor.codes/apt bionic Release [2611 B]
Get:7 https://repo.vapor.codes/apt bionic Release.gpg [819 B]
Get:8 https://repo.vapor.codes/apt bionic/main amd64 Packages [2095 B]
Fetched 5525 B in 1s (3929 B/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Removing intermediate container f713e7a61d58
 ---> 28527b1733dd
Step 13/25 : RUN mkdir /root/vapor
 ---> Running in 19d135a11dc3
Removing intermediate container 19d135a11dc3
 ---> 67e735fb179f
Step 14/25 : ADD . /root/vapor
 ---> f23c5c3a8edd
Step 15/25 : WORKDIR /root/vapor
 ---> Running in 3c5aba746533
Removing intermediate container 3c5aba746533
 ---> 502d9897a4ff
Step 16/25 : RUN cd /root/vapor && rm -rf .build
 ---> Running in ecb9d0620471
Removing intermediate container ecb9d0620471
 ---> 53dc5bfeecc0
Step 17/25 : RUN swift package update
 ---> Running in 22bc9438e8ac
Fetching https://github.com/vapor/vapor.git
Fetching https://github.com/vapor/fluent-mysql.git
Fetching https://github.com/vapor/jwt.git
Fetching https://github.com/krzyzanowskim/CryptoSwift.git
Fetching https://github.com/vapor-community/sendgrid-provider.git
Fetching https://github.com/vapor-community/lingo-vapor.git
Fetching https://github.com/skelpo/JWTDataProvider.git
Fetching https://github.com/skelpo/JWTVapor.git
Fetching https://github.com/skelpo/SkelpoMiddleware.git
Fetching https://github.com/vapor/console.git
Fetching https://github.com/vapor/core.git
Fetching https://github.com/vapor/crypto.git
Fetching https://github.com/vapor/database-kit.git
Fetching https://github.com/vapor/http.git
Fetching https://github.com/vapor/multipart.git
Fetching https://github.com/vapor/routing.git
Fetching https://github.com/vapor/service.git
Fetching https://github.com/vapor/template-kit.git
Fetching https://github.com/vapor/url-encoded-form.git
Fetching https://github.com/vapor/validation.git
Fetching https://github.com/vapor/websocket.git
Fetching https://github.com/apple/swift-nio.git
Fetching https://github.com/apple/swift-nio-zlib-support.git
Fetching https://github.com/apple/swift-nio-ssl-support.git
Fetching https://github.com/apple/swift-nio-ssl.git
Fetching https://github.com/vapor/fluent.git
Fetching https://github.com/vapor/mysql.git
Fetching https://github.com/vapor/sql.git
Fetching https://github.com/miroslavkovac/Lingo.git
Fetching https://github.com/skelpo/JSON.git
Fetching https://github.com/vapor/auth.git
Fetching https://github.com/vapor/fluent-sqlite.git
Fetching https://github.com/vapor/sqlite.git
Fetching https://github.com/skelpo/JWTMiddleware.git
Fetching https://github.com/skelpo/APIErrorMiddleware.git
Fetching https://github.com/skelpo/vapor-request-storage
Completed resolution in 26.00s
Cloning https://github.com/vapor/multipart.git
Resolving https://github.com/vapor/multipart.git at 3.0.4
Cloning https://github.com/vapor/http.git
Resolving https://github.com/vapor/http.git at 3.2.1
Cloning https://github.com/vapor/database-kit.git
Resolving https://github.com/vapor/database-kit.git at 1.3.3
Cloning https://github.com/skelpo/JWTMiddleware.git
Resolving https://github.com/skelpo/JWTMiddleware.git at 0.10.0
Cloning https://github.com/skelpo/APIErrorMiddleware.git
Resolving https://github.com/skelpo/APIErrorMiddleware.git at 0.3.5
Cloning https://github.com/apple/swift-nio-ssl.git
Resolving https://github.com/apple/swift-nio-ssl.git at 1.4.0
Cloning https://github.com/vapor/template-kit.git
Resolving https://github.com/vapor/template-kit.git at 1.4.0
Cloning https://github.com/miroslavkovac/Lingo.git
Resolving https://github.com/miroslavkovac/Lingo.git at 3.0.5
Cloning https://github.com/vapor/routing.git
Resolving https://github.com/vapor/routing.git at 3.0.2
Cloning https://github.com/vapor/vapor.git
Resolving https://github.com/vapor/vapor.git at 3.3.0
Cloning https://github.com/vapor/sql.git
Resolving https://github.com/vapor/sql.git at 2.3.2
Cloning https://github.com/vapor/core.git
Resolving https://github.com/vapor/core.git at 3.9.1
Cloning https://github.com/vapor/fluent.git
Resolving https://github.com/vapor/fluent.git at 3.2.0
Cloning https://github.com/skelpo/JWTDataProvider.git
Resolving https://github.com/skelpo/JWTDataProvider.git at 1.0.0
Cloning https://github.com/vapor/fluent-mysql.git
Resolving https://github.com/vapor/fluent-mysql.git at 3.0.1
Cloning https://github.com/skelpo/JSON.git
Resolving https://github.com/skelpo/JSON.git at 0.13.1
Cloning https://github.com/vapor/crypto.git
Resolving https://github.com/vapor/crypto.git at 3.3.3
Cloning https://github.com/krzyzanowskim/CryptoSwift.git
Resolving https://github.com/krzyzanowskim/CryptoSwift.git at 1.0.0
Cloning https://github.com/vapor/url-encoded-form.git
Resolving https://github.com/vapor/url-encoded-form.git at 1.0.6
Cloning https://github.com/vapor/validation.git
Resolving https://github.com/vapor/validation.git at 2.1.1
Cloning https://github.com/vapor-community/sendgrid-provider.git
Resolving https://github.com/vapor-community/sendgrid-provider.git at 3.0.6
Cloning https://github.com/vapor/sqlite.git
Resolving https://github.com/vapor/sqlite.git at 3.2.1
Cloning https://github.com/vapor/websocket.git
Resolving https://github.com/vapor/websocket.git at 1.1.2
Cloning https://github.com/vapor/jwt.git
Resolving https://github.com/vapor/jwt.git at 3.0.0
Cloning https://github.com/apple/swift-nio-zlib-support.git
Resolving https://github.com/apple/swift-nio-zlib-support.git at 1.0.0
Cloning https://github.com/skelpo/JWTVapor.git
Resolving https://github.com/skelpo/JWTVapor.git at 0.14.0
Cloning https://github.com/vapor/service.git
Resolving https://github.com/vapor/service.git at 1.0.2
Cloning https://github.com/vapor/auth.git
Resolving https://github.com/vapor/auth.git at 2.0.4
Cloning https://github.com/vapor/mysql.git
Resolving https://github.com/vapor/mysql.git at 3.2.5
Cloning https://github.com/vapor/fluent-sqlite.git
Resolving https://github.com/vapor/fluent-sqlite.git at 3.0.0
Cloning https://github.com/apple/swift-nio.git
Resolving https://github.com/apple/swift-nio.git at 1.14.1
Cloning https://github.com/vapor/console.git
Resolving https://github.com/vapor/console.git at 3.1.1
Cloning https://github.com/apple/swift-nio-ssl-support.git
Resolving https://github.com/apple/swift-nio-ssl-support.git at 1.0.0
Cloning https://github.com/skelpo/SkelpoMiddleware.git
Resolving https://github.com/skelpo/SkelpoMiddleware.git at 1.4.0
Cloning https://github.com/vapor-community/lingo-vapor.git
Resolving https://github.com/vapor-community/lingo-vapor.git at 3.0.1
Cloning https://github.com/skelpo/vapor-request-storage
Resolving https://github.com/skelpo/vapor-request-storage at 0.4.0
Removing intermediate container 22bc9438e8ac
 ---> 3761cabd667f
Step 18/25 : RUN swift build --configuration release
 ---> Running in 88800cd617c2
'swift-nio-zlib-support' zlib.pc: warning: couldn't find pc file
'swift-nio-ssl-support' openssl.pc: warning: couldn't find pc file
[1/65] Compiling CNIOZlib empty.c
[2/65] Compiling Swift Module 'NIOPriorityQueue' (2 sources)
[3/65] Compiling Swift Module 'Lingo' (163 sources)
[4/65] Compiling Swift Module 'JSON' (18 sources)
[5/65] Compiling Swift Module 'Debugging' (3 sources)
[6/65] Compiling Swift Module 'CryptoSwift' (75 sources)
[7/65] Compiling Swift Module 'COperatingSystem' (1 sources)
[8/65] Compiling CNIOSHA1 c_nio_sha1.c
[9/65] Compiling CNIOOpenSSL shims.c
In file included from /root/vapor/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/shims.c:16:
/root/vapor/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h:17:10: fatal error: 'openssl/conf.h' file not found
#include <openssl/conf.h>
         ^~~~~~~~~~~~~~~~
1 error generated.
The command '/bin/sh -c swift build --configuration release' returned a non-zero code: 1
Unable to find image 'users:latest' locally
docker: Error response from daemon: pull access denied for users, repository does not exist or may require 'docker login'.
See 'docker run --help'.

@calebkleveter
Copy link
Contributor

Correct, though I don't know if you just need to install it, or install a specific version or what. It looks like we never even install that in the docker container, so I'd say try adding the install instruction to your cloned repo and see if that does the trick.

@rchatham
Copy link
Author

Changed line 7 of the Dockerfile to RUN apt-get update && apt-get -y install wget lsb-release apt-transport-https openssl but no avail, still getting the same error.

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

No branches or pull requests

2 participants