Skip to content

Instantly share code, notes, and snippets.

@umidjons
Last active October 16, 2017 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umidjons/f75d24309a0911dba8ab3ca97b17c3b8 to your computer and use it in GitHub Desktop.
Save umidjons/f75d24309a0911dba8ab3ca97b17c3b8 to your computer and use it in GitHub Desktop.
Dockerization of the connect-release

Dockerization of the connect-release

Dockerfile

Folder structure:

|_ project
  |_ assets
    |_ connect-release.tar.gz
  |_ Dockerfile

File Dockerfile:

FROM ubuntu:16.04

SHELL ["/bin/bash", "-c"]

ENV ARCH_FILE=connect-release.tar.gz \
  FOLDER=connect-release \
  EXECUTABLE=ShazzleMailConnect \
  QT_QPA_PLATFORM=offscreen

WORKDIR /

COPY assets/${ARCH_FILE} /

# Prerequisites
RUN apt-get update \
  && DEBIAN_FRONEND=noninteractive apt-get install -y libglu1 libgtk2.0-0 libsm6 \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/*

# Prepare the executable
RUN tar -zxf ${ARCH_FILE} \
  && rm ${ARCH_FILE} \
  && chmod +x ${FOLDER}/${EXECUTABLE}

WORKDIR /${FOLDER}

ENTRYPOINT ["./ShazzleMailConnect"]

Build

Build docker images:

cd project
docker build -t connect .

List available images:

docker images

Remove unnecessary image:

docker rmi conn

Run the container

Run in detached mode:

# be sure, there is no other container with the same name
docker stop conn

# remove older container, if not needed anymore
docker rm conn

# run the container in detached mode, give it a name conn
docker run --name conn -d connect

# show logs
docker logs --follow --tail conn

Connect into running container

docker exec -it conn bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment