Skip to content

Commit

Permalink
Updates for Stata 14
Browse files Browse the repository at this point in the history
  • Loading branch information
larsvilhuber committed Apr 22, 2021
1 parent 598a137 commit 3678c8f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# First stage
FROM ubuntu:20.04 as install
ENV VERSION 16
ENV VERSION 14
# cheating for now
COPY bin-exclude/stata-installed-${VERSION}.tgz /root/stata.tgz
RUN cd / && tar xzf $HOME/stata.tgz \
Expand All @@ -9,12 +9,19 @@ RUN cd / && tar xzf $HOME/stata.tgz \
# Final build
FROM ubuntu:20.04
RUN apt-get update \
&& apt-get install -y locales libncurses5 libpng16-16 \
&& apt-get install -y locales libncurses5 \
&& apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV libpng http://ppa.launchpad.net/linuxuprising/libpng12/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1+1~ppa0~focal_amd64.deb
RUN apt-get update \
&& apt-get install -y wget \
&& wget -O libpng.deb "${libpng}" \
&& dpkg --install libpng.deb \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f libpng.deb
ENV LANG en_US.utf8
ENV VERSION 16
ENV VERSION 14

# copying from first stage
COPY --from=install /usr/local/stata${VERSION}/ /usr/local/stata${VERSION}/
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Now you can upload it. Set the `TAG` and `IMAGEID` accordingly.

```
IMAGEID=52e8f83a14f8
VERSION=16
VERSION=14
TAG=$(date +%F)
MYHUBID=dataeditors
MYIMG=stata${VERSION}
Expand All @@ -71,7 +71,7 @@ Using a pre-built image on [Docker Hub](https://hub.docker.com/repository/docker
### To enter interactive stata

```
VERSION=16
VERSION=14
docker run -it --rm \
-v $(pwd)/stata.lic.${VERSION}:/usr/local/stata${VERSION}/stata.lic \
-v $(pwd)/code:/code \
Expand All @@ -86,7 +86,7 @@ The docker image has a `ENTRYPOINT` defined, which means it will act as if you w


```
VERSION=16
VERSION=14
docker run -it --rm \
-v $(pwd)/stata.lic.${VERSION}:/usr/local/stata${VERSION}/stata.lic \
-v $(pwd)/code:/code \
Expand All @@ -107,10 +107,10 @@ global results "${basedir}results"
### Using the container to build a project-specific docker image

- Adjust the `setup.do` file - list all packages you want installed permanently.
- Remember to have the `stata.lic.16` file available
- Remember to have the `stata.lic.14` file available
- Start your Dockerfile with
```
FROM dataeditors/stata16:2021-04-21
FROM dataeditors/stata14:2021-04-21
# this makes the copy work
COPY stata.lic.${VERSION} /root/stata.lic
RUN mv $HOME/stata.lic /usr/local/stata${VERSION}/
Expand Down

0 comments on commit 3678c8f

Please sign in to comment.