protoc-artifacts: Use ENTRYPOINT to enable devtoolset-1.1

ENTRYPOINT is used even when other commands are specified on the "docker
run" command line. This allows running one-off commands in the docker
image (especially combined with volume binding with the host) with the
correct environment variables.
pull/4447/head
Eric Anderson 7 years ago
parent 67c1cd4cb7
commit cdbfdd8da8
  1. 4
      protoc-artifacts/Dockerfile
  2. 2
      protoc-artifacts/README.md
  3. 13
      protoc-artifacts/scl-enable-devtoolset.sh

@ -39,5 +39,7 @@ RUN wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo -P /etc/yum
devtoolset-1.1-libstdc++-devel.i686 && \
yum clean all
COPY scl-enable-devtoolset.sh /var/local/
# Start in devtoolset environment that uses GCC 4.7
CMD ["scl", "enable", "devtoolset-1.1", "bash"]
ENTRYPOINT ["/var/local/scl-enable-devtoolset.sh"]

@ -140,7 +140,7 @@ $ docker build -t protoc-artifacts .
To run the image:
```
$ docker run -it --rm=true protoc-artifacts
$ docker run -it --rm=true protoc-artifacts bash
```
To checkout protobuf (run within the container):

@ -0,0 +1,13 @@
#!/bin/bash
set -eu -o pipefail
quote() {
local arg
for arg in "$@"; do
printf "'"
printf "%s" "$arg" | sed -e "s/'/'\\\\''/g"
printf "' "
done
}
exec scl enable devtoolset-1.1 "$(quote "$@")"
Loading…
Cancel
Save