I hope this helps you . I was able to update and enhance my dockerfile this is now running smoothly and also can be used for CI and CD tasks.
LABEL maintainer="IBM Swift Engineering at IBM Cloud"
LABEL Description="Template Dockerfile that extends the ibmcom/swift-ubuntu-runtime image."
# We can replace this port with what the user wants
# Default user if not provided
# Install system level packages
RUN apt-get update && apt-get dist-upgrade -y
RUN apt-get update && apt-get install -y sudo libmysqlclient-dev
# Add utils files
ADD https://raw.githubusercontent.com/IBM-Swift/swift-ubuntu-docker/master/utils/run-utils.sh /swift-utils/run-utils.sh
ADD https://raw.githubusercontent.com/IBM-Swift/swift-ubuntu-docker/master/utils/common-utils.sh /swift-utils/common-utils.sh
RUN chmod -R 555 /swift-utils
# Create user if not root
RUN if [ $bx_dev_user != "root" ]; then useradd -ms /bin/bash -u $bx_dev_userid $bx_dev_user; fi
# Bundle application source & binaries
COPY ./.build /swift-project/.build
# Command to start Swift application
CMD [ "sh", "-c", "cd /swift-project && .build/release/Beautylivery_Server_New" ]
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.
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
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
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