Skip to content

Commit

Permalink
Use Ubuntu instead of Alpine Linux
Browse files Browse the repository at this point in the history
Issue with static linking for C interp libraries.
  • Loading branch information
OopsOverflow committed Feb 1, 2022
1 parent 343c14a commit 3a053eb
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 3,691 deletions.
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
doc
_build
_build
output.txt
comp
*.o
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
FROM ocaml/opam:alpine AS init-opam
FROM ocaml/opam:ubuntu-16.04 AS init-opam

RUN set -x && \
git -C /home/opam/opam-repository pull origin master && opam update && \
opam upgrade

RUN set -x && \
: "Update and upgrade default packagee" && \
sudo apk update && sudo apk upgrade && \
sudo apk add linux-headers
sudo apt-get install && sudo apt-get upgrade && \
sudo apt-get install bison flex -y

# --- #

FROM init-opam AS kat
COPY . .

RUN set -x && \
: "Install related pacakges" && \
opam install . --deps-only && \
eval $(opam env) && \
: "Build applications" && \
dune build

RUN set -x && \
: "Building Interp" && \
cd interprete && sudo make clean && sudo make

#SSH §
EXPOSE 3000

# TODO : CMD [ "executable" ]
LABEL org.opencontainers.image.source="https://github.com/OopsOverflow/turbo_katana"

# TODO : CMD [ "executable" ]
55 changes: 34 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
# -------------------------------
# Docker part

ARG := $(word 2, $(MAKECMDGOALS))
PROG := $(word 2, $(MAKECMDGOALS))
$(eval $(PROG):;@:)

docker_setup:
docker volume create katana
docker-compose build katana --parallel

docker_up:
docker-compose up -d
@echo 'Running docker Image, Port 3000 Exposed'

docker_down:
docker-compose down

docker_logs:
docker-compose logs -f $(ARG)

docker_run:
docker run --rm -it turbo_katana_katana:latest

katana:
@echo ">>> Running Turbo Katana v1.0.1.b"
@echo ">>> Target" $(PROG)
dune exec compilc $(PROG) | interprete/interp



# -------------------------------
# Other Part

LIB_SRCS := ast.ml optmanip.ml env.ml astmanip.ml addrs.ml contextual.ml util.ml vtable.ml compil.ml
BUILD_DIR := _build

Expand Down Expand Up @@ -30,24 +64,3 @@ clean:
rm -rf $(BUILD_DIR)
mkdir $(BUILD_DIR)

# -------------------------------
# Docker part

ARG := $(word 2, $(MAKECMDGOALS))

docker_setup:
docker volume create katana
docker-compose build katana --parallel

docker_up:
docker-compose up -d
@echo 'Running docker Image, Port 3000 Exposed'

docker_down:
docker-compose down

docker_logs:
docker-compose logs -f $(ARG)

docker_run:
docker run --rm -it turbo_katana_katana:latest
Loading

0 comments on commit 3a053eb

Please sign in to comment.