Applied minor fixes to readme of golang and gcc

This commit is contained in:
Moghedrin 2014-09-05 11:10:24 -06:00
parent 6e82955a93
commit 571b4bae20
4 changed files with 10 additions and 10 deletions

View File

@ -12,13 +12,13 @@ For this image, the most straight-forward use is to use a gcc container as both
FROM gcc FROM gcc
ADD . /usr/src/myapp ADD . /usr/src/myapp
WORKDIR /usr/src/myapp WORKDIR /usr/src/myapp
RUN gcc -o executable main.c RUN gcc -o myapp main.c
CMD ["./executable"] CMD ["./myapp"]
Then run the commands to build and run the docker image. Then run the commands to build and run the docker image.
docker build -t my-gcc-app . docker build -t my-gcc-app .
docker run -it --rm --name my-running-app my-gcc-app ./myapp docker run -it --rm --name my-running-app my-gcc-app
## Compile your app inside the docker container. ## Compile your app inside the docker container.
@ -28,4 +28,4 @@ It is not always appropriate to run your app inside a container. In instances wh
This will add your current directory as a volume to the comtainer, set the working directory to the volume, and run the command `gcc -o myapp myapp.c` which will tell gcc to compile the code in myapp.c and output the executable to myapp. Alternatively, if you have a make file, you can instead run the make command inside your container. This will add your current directory as a volume to the comtainer, set the working directory to the volume, and run the command `gcc -o myapp myapp.c` which will tell gcc to compile the code in myapp.c and output the executable to myapp. Alternatively, if you have a make file, you can instead run the make command inside your container.
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp make docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc make

View File

@ -12,13 +12,13 @@ For this image, the most straight-forward use is to use a gcc container as both
FROM gcc FROM gcc
ADD . /usr/src/myapp ADD . /usr/src/myapp
WORKDIR /usr/src/myapp WORKDIR /usr/src/myapp
RUN gcc -o executable main.c RUN gcc -o myapp main.c
CMD ["./executable"] CMD ["./myapp"]
Then run the commands to build and run the docker image. Then run the commands to build and run the docker image.
docker build -t my-gcc-app . docker build -t my-gcc-app .
docker run -it --rm --name my-running-app my-gcc-app ./myapp docker run -it --rm --name my-running-app my-gcc-app
## Compile your app inside the docker container. ## Compile your app inside the docker container.
@ -28,7 +28,7 @@ It is not always appropriate to run your app inside a container. In instances wh
This will add your current directory as a volume to the comtainer, set the working directory to the volume, and run the command `gcc -o myapp myapp.c` which will tell gcc to compile the code in myapp.c and output the executable to myapp. Alternatively, if you have a make file, you can instead run the make command inside your container. This will add your current directory as a volume to the comtainer, set the working directory to the volume, and run the command `gcc -o myapp myapp.c` which will tell gcc to compile the code in myapp.c and output the executable to myapp. Alternatively, if you have a make file, you can instead run the make command inside your container.
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp make docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc make
# Issues and Contributing # Issues and Contributing

View File

@ -18,7 +18,7 @@ For this image, the most straight-forward use is to use a golang container as bo
Then run and build the docker image. Then run and build the docker image.
docker build -t my-golang-app docker build -t my-golang-app
docker run -it --rm --name my-running-app my-golang-app ./myapp docker run -it --rm --name my-running-app my-golang-app
## Compile your app inside the docker container. ## Compile your app inside the docker container.

View File

@ -18,7 +18,7 @@ For this image, the most straight-forward use is to use a golang container as bo
Then run and build the docker image. Then run and build the docker image.
docker build -t my-golang-app docker build -t my-golang-app
docker run -it --rm --name my-running-app my-golang-app ./myapp docker run -it --rm --name my-running-app my-golang-app
## Compile your app inside the docker container. ## Compile your app inside the docker container.