Ubuntu/Centos docker with swift 3

Hi everybody,

I would like to know if somebody use Docker with image of Ubuntu or Centos with swift 3 on them to make a working dev environment ?

I just start to learn Docker use, which is not hard obviously, but I wonder if we can build a complete development environment with it …

Any advices welcome.

Regards

Gerard

Yes, it's possible to build a Docker image with the necessary binaries installed. You can use a pre-built one from IBM:

It has more than is strictly necessary to get up and working but you can use it to get going. Alternatively, you can install your own by basing it on the following from Ubuntu 16.04:

FROM ubuntu:16.04

RUN apt-get update && apt-get -y install vim wget git clang libicu-dev python2.7-dev libxml2-dev libcurl4-openssl-dev && apt-get clean

RUN wget --progress=bar:force:noscroll --output-document=- https://swift.org/builds/swift-3.0.1-release/ubuntu1604/swift-3.0.1-RELEASE/swift-3.0.1-RELEASE-ubuntu16.04.tar.gz | tar --strip-components=1 -zxf -

···

On 12 Dec 2016, at 11:06, Gerard Iglesias via swift-users <swift-users@swift.org> wrote:

Hi everybody,

I would like to know if somebody use Docker with image of Ubuntu or Centos with swift 3 on them to make a working dev environment ?

I just start to learn Docker use, which is not hard obviously, but I wonder if we can build a complete development environment with it …

Any advices welcome.

Great

Thank you a lot.

···

On 12 Dec 2016, at 13:49, Alex Blewitt <alblue@apple.com> wrote:

On 12 Dec 2016, at 11:06, Gerard Iglesias via swift-users <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:

Hi everybody,

I would like to know if somebody use Docker with image of Ubuntu or Centos with swift 3 on them to make a working dev environment ?

I just start to learn Docker use, which is not hard obviously, but I wonder if we can build a complete development environment with it …

Any advices welcome.

Yes, it's possible to build a Docker image with the necessary binaries installed. You can use a pre-built one from IBM:

GitHub - Kitura/swift-ubuntu-docker: 🚫 This repo is deprecated - please use the images here: https://hub.docker.com/_/swift

It has more than is strictly necessary to get up and working but you can use it to get going. Alternatively, you can install your own by basing it on the following from Ubuntu 16.04:

FROM ubuntu:16.04

RUN apt-get update && apt-get -y install vim wget git clang libicu-dev python2.7-dev libxml2-dev libcurl4-openssl-dev && apt-get clean

RUN wget --progress=bar:force:noscroll --output-document=- https://swift.org/builds/swift-3.0.1-release/ubuntu1604/swift-3.0.1-RELEASE/swift-3.0.1-RELEASE-ubuntu16.04.tar.gz | tar --strip-components=1 -zxf -

Hello,

Something important to note, i have created an image from scratch installing emacs in place of vim.

But to get swift working we have to run the image with privilege access like this

docker run -ti --privileged=true theImageName

Unless we get an error when running the REPL

Regards

Gerard

···

On 12 Dec 2016, at 13:49, Alex Blewitt <alblue@apple.com> wrote:

On 12 Dec 2016, at 11:06, Gerard Iglesias via swift-users <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:

Hi everybody,

I would like to know if somebody use Docker with image of Ubuntu or Centos with swift 3 on them to make a working dev environment ?

I just start to learn Docker use, which is not hard obviously, but I wonder if we can build a complete development environment with it …

Any advices welcome.

Yes, it's possible to build a Docker image with the necessary binaries installed. You can use a pre-built one from IBM:

GitHub - Kitura/swift-ubuntu-docker: 🚫 This repo is deprecated - please use the images here: https://hub.docker.com/_/swift

It has more than is strictly necessary to get up and working but you can use it to get going. Alternatively, you can install your own by basing it on the following from Ubuntu 16.04:

FROM ubuntu:16.04

RUN apt-get update && apt-get -y install vim wget git clang libicu-dev python2.7-dev libxml2-dev libcurl4-openssl-dev && apt-get clean

RUN wget --progress=bar:force:noscroll --output-document=- https://swift.org/builds/swift-3.0.1-release/ubuntu1604/swift-3.0.1-RELEASE/swift-3.0.1-RELEASE-ubuntu16.04.tar.gz | tar --strip-components=1 -zxf -

Yes, if you want to run the repl or lldb then you either need --privileged or --security-opt seccomp:unconfined and --cap-add SYS_PTRACE.

You might also want to specify --rm which will remove your containers runtime image afterwards, as otherwise you will end up with many nearly identical copies of your container on disk.

Alex

···

Sent from my iPhone :iphone:

On 12 Dec 2016, at 22:32, Gerard Iglesias <gerard_iglesias@me.com> wrote:

Hello,

Something important to note, i have created an image from scratch installing emacs in place of vim.

But to get swift working we have to run the image with privilege access like this

docker run -ti --privileged=true theImageName

Unless we get an error when running the REPL