Use Docker + Kitura, but not on a Mac
Tag : docker , By : Jet Thompson
Date : March 29 2020, 07:55 AM
around this issue Your options are limited. First of all Swift is only certified at this moment on Ubuntu. So the host you want to develop on either must run Ubuntu or alternatively must run Docker under which you can run Ubuntu. In theory you can also compile swift on your target host. I did this for an older version of Swift once for Debain (Jessie) and although I managed to get it compiled it was certainly not stable. Things may have improved since then, I haven't checked that. SwiftDocker2 ()
{
name=`perl -e 'open IN, "</usr/share/dict/words";rand($.) \
< 1 && ($n=$_) while <IN>;print $n'`;
docker run -i -t --name=${name} -h ${name} --log-driver=json-file \
-w /project -v $(pwd):/project -p 9000:9000 ibmcom/swift-ubuntu /bin/bash;
echo "Created image ${name}";
echo "Stopping image";
docker stop ${name};
echo "Removing image";
docker rm ${name}
}
BUILD_LINUX = "./.build-linux"
BUILD_MACOS = "./.build-macos"
UNAME = $(shell uname)
ifeq (${UNAME}, Darwin)
BUILD_PATH = ${BUILD_MACOS}
else
BUILD_PATH = ${BUILD_LINUX}
endif
xcode:
@swift package --build-path ${BUILD_PATH} -Xlinker -L/usr/local/lib generate-xcodeproj
build:
rm -f Package.pins
swift build --build-path ${BUILD_PATH} -Xlinker "-L/usr/local/lib"
|
Docker Build Kitura Sqift Container - Shim.h mysql.h file not found
Date : December 31 2020, 02:31 AM
To fix the issue you can do The problem here is that the ibmcom/swift-ubuntu:5.0.2 image is built on top of Ubuntu 14.04. The version of libmysqlclient-dev supplied with 14.04 does not include the pkg-config information that allows the Swift compiler to find the headers without help. There are two solutions to this problem:
|
I get error Unable to find docker image locally; However I can run the image using docker run command
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , The problem was that the VM cluster instances created did not have the .docker/config.json file in them. Hence the docker image could not be pulled by the VMs, resulting in the error. One way to resolve this is to SSH into the VMs and run the docker-credential-gcr configure-docker command. This generates the .docker/config.json folder/file successfully allowing the VMs to pull the images.
|
Can't create a docker image for COPY failed: stat /var/lib/docker/tmp/docker-builder error
Date : March 29 2020, 07:55 AM
it helps some times I want to create a docker image. This is my work directory: Dockerfile.in test.json test.py , You should put those files into the same directory with Dockerfile.
|
Library not loaded: @rpath/libmysqlclient.21.dylib Reason: image not found Django migrate error using mysqlclient DB dri
Date : March 29 2020, 07:55 AM
around this issue While changing to a MySQL database from the default SQLite one that Django uses by default, I ran into this tricky error while trying to run python manage.py migrate --database mysql: , Just create a symbolic link in /usr/local/lib sudo ln -s /usr/local/mysql/lib/libmysqlclient.21.dylib /usr/local/lib/libmysqlclient.21.dylib
|